Commit Graph

78 Commits (48991bf6c4f9d39f30a7795ede75871f86a4d06b)

Author SHA1 Message Date
Tonis Tiigi 0a7f6ccf5e dockerfile: parse comments associated with args and stages
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-12 23:11:23 -07:00
Tonis Tiigi c810b8ed25 dockerfile: allow multiple values for ARG
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-09-22 11:56:51 -07:00
Tonis Tiigi 90288ab716 errdefs: update to new packages
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-24 11:25:44 -07:00
Tonis Tiigi 4b2636acca dockerfile: add more source information to errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-21 23:46:17 -07:00
Tonis Tiigi cce301badd solver: attach causing vertex in an error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-21 23:46:17 -07:00
Tonis Tiigi e2835e55ad dockerfile: store error location in instructions parser
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-19 20:56:31 -07:00
Tonis Tiigi ea7a9146a2 dockerfile: include parser error location
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-19 15:54:58 -07:00
Tonis Tiigi 37b8832d00 upgrade errors checks to Is()
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-18 22:53:38 -07:00
Tonis Tiigi c157d8a3ef dockerfile: remove mix of testing frameworks
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-14 22:05:41 -07:00
Tonis Tiigi f2307db707 dockerfile: nicer subtest cases in parser tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-14 22:05:41 -07:00
Tonis Tiigi 7c0493de8d dockerfile: fix parsing multiple directives
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-14 22:04:53 -07:00
Pratik Raj 2910de68b1 optimization debian package manager tweaks
By default, Ubuntu or Debian based "apt" or "apt-get" system installs recommended but not suggested packages .

By passing "--no-install-recommends" option, the user lets apt-get know not to consider recommended packages as a dependency to install.

This results in smaller downloads and installation of packages .

Refer to blog at [Ubuntu Blog](https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends) .

Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
2020-03-11 15:27:54 +05:30
Nathan Sullivan 7c2b06fae9 export parser endLine (make public). StartLine is already public.
https://github.com/moby/buildkit/issues/1028

Signed-off-by: Nathan Sullivan <nathan@nightsys.net>
2019-05-31 13:48:02 +10:00
linuxmercedes 2ec7d53b00 Parser errors on dockerfiles without instructions
See https://github.com/moby/moby/pull/38487 for more discussion.

Signed-off-by: Natasha Jarus <linuxmercedes@gmail.com>
2019-01-04 13:44:52 -06:00
Vincent Demeester 79241f25d5
Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-11 15:52:17 +02:00
Tonis Tiigi 76d15da0d5 dockerfile: update imports
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-01 20:10:18 -07:00
Sebastiaan van Stijn 9dc3c39c2c Various code-cleanup
remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

rewritten from github.com/moby/moby f23c00d8701e4bd0f2372a586dacbf66a26f9a51
2018-06-01 20:10:13 -07:00
Eli Uriegas 30a794fa73 Remove references to old release process
This hasn't been the way to release Docker for the past year so let's
just remove them altogether

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>

rewritten from github.com/moby/moby 80bc8b4766cc808186af91930152d78afb22aef8
2018-06-01 20:10:13 -07:00
Dennis Chen 49550b05a5 Remove unused 'label' related functions
Since we use `NewLabelCommand()` instead of `addNodesForLabelOption()`
to create the 'LABEL' commands from '--label' options, so all the related
functions should be removed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>

rewritten from github.com/moby/moby c7b543164daed58fbea36471592438b4e53ab748
2018-06-01 20:10:13 -07:00
John Howard 9f97edb9e4 Builder - Parser. Remove platform parser directive
Signed-off-by: John Howard <jhoward@microsoft.com>

rewritten from github.com/moby/moby 9cae03900fc27ff39e913978ca8f084691954881
2018-06-01 20:10:13 -07:00
John Howard 99f656e7fd Builder - parser - remove OS
Signed-off-by: John Howard <jhoward@microsoft.com>

rewritten from github.com/moby/moby 98dd1fdca1f5b82cbc7066c4a48f9ddd8f135095
2018-06-01 20:10:13 -07:00
Daniel Nephin 414a98c2e0 Post migration assertion fixes
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby c9e52bd0da0461e605a3678b85702f83081504a7
2018-06-01 20:10:13 -07:00
Daniel Nephin 3b28b903b9 Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 6be0f709830113966f295401327b027ec2f0bbca
2018-06-01 20:10:13 -07:00
Daniel Nephin a3b7488b81 Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 4f0d95fa6ee7f865597c03b9e63702cdcb0f7067
2018-06-01 20:10:13 -07:00
Anthony Sottile 0d95b8138b Change references from test-integration-cli to test-integration
Signed-off-by: Anthony Sottile <asottile@umich.edu>

rewritten from github.com/moby/moby b6eed3dca2e57705cb75895cad0b5337c79686d9
2018-06-01 20:10:13 -07:00
Daniel Nephin 2dc37b2ae6 Fix dockerfile parser failing silently on long tokens
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 59ad3a36e2684bd36a4b02179949bd17f1406918
2018-06-01 20:10:13 -07:00
John Howard c7f561d8fa LCOW: API: Add platform to /images/create and /build
Signed-off-by: John Howard <jhoward@microsoft.com>

This PR has the API changes described in https://github.com/moby/moby/issues/34617.
Specifically, it adds an HTTP header "X-Requested-Platform" which is a JSON-encoded
OCI Image-spec `Platform` structure.

In addition, it renames (almost all) uses of a string variable platform (and associated)
methods/functions to os. This makes it much clearer to disambiguate with the swarm
"platform" which is really os/arch. This is a stepping stone to getting the daemon towards
fully multi-platform/arch-aware, and makes it clear when "operating system" is being
referred to rather than "platform" which is misleadingly used - sometimes in the swarm
meaning, but more often as just the operating system.

rewritten from github.com/moby/moby 0380fbff37922cadf294851b1546f4c212c7f364
2018-06-01 20:10:13 -07:00
Sebastiaan van Stijn 4afd7bf50e Warn on empty continuation lines only, not for comments
Commit 8d1ae76dcbbb73d8e20c6a14a7d3fe2410b95f55 added
deprecation warnings for empty continuation lines,
but also treated comment-only lines as empty.

This patch distinguishes empty continuation lines
from comment-only lines, and only outputs warnings
for the former.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

rewritten from github.com/moby/moby 2fd736ac10c1c46d1001373d887cb99b3d8ee824
2018-06-01 20:10:13 -07:00
Daniel Nephin 52c2623316 Add gosimple linter
Update gometalinter

Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby f7f101d57ef8cbf2d8723a18b7d723c5c5dd04b6
2018-06-01 20:10:13 -07:00
Daniel Nephin 2a8909c525 Fix golint errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 9b47b7b1519c5f2138e2933fb1fc459eb00895c0
2018-06-01 20:10:13 -07:00
John Howard 0b8ce214e4 LCOW: Fix nits from 33241
Signed-off-by: John Howard <jhoward@microsoft.com>

rewritten from github.com/moby/moby 4ec9766a27ffb964cec6b8b2745725965b2644aa
2018-06-01 20:10:13 -07:00
Daniel Nephin 9def101b4a Add a test for warning on empty continuation lines.
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby b47b375cb8bb0dca7ee0ebfa093bfc163ad867fb
2018-06-01 20:10:13 -07:00
Yong Tang 9e0819d2a5 Warn/deprecate continuing on empty lines in `Dockerfile`
This fix is related to 29005 and 24693. Currently in `Dockerfile`
empty lines will continue as long as there is line escape before.
This may cause some issues. The issue in 24693 is an example.
A non-empty line after an empty line might be considered to be a
separate instruction by many users. However, it is actually part
of the last instruction under the current `Dockerfile` parsing
rule.

This fix is an effort to reduce the confusion around the parsing
of `Dockerfile`. Even though this fix does not change the behavior
of the `Dockerfile` parsing, it tries to deprecate the empty line
continuation and present a warning for the user. In this case,
at least it prompt users to check for the Dockerfile and avoid
the confusion if possible.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

rewritten from github.com/moby/moby 7815c8f8754d5473eda7cd80277a4ea3c59e3c29
2018-06-01 20:10:13 -07:00
John Howard 8a646a6115 LCOW: Builder plumbing
Signed-off-by: John Howard <jhoward@microsoft.com>

rewritten from github.com/moby/moby 08252bc963a20b2fb3052fc8db7143771c8c3248
2018-06-01 20:10:13 -07:00
Akihiro Suda a5bcc22c39 builder: add a test for `ENV name` (without `=value`)
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>

rewritten from github.com/moby/moby 09eca591f723f9acd0909b04144c229b6cd59912
2018-06-01 20:10:13 -07:00
John Howard 1b72890ca2 Builder: Fix parser directive refactoring
Signed-off-by: John Howard <jhoward@microsoft.com>

rewritten from github.com/moby/moby c97170d618b7a1f35f47672143bd287666802287
2018-06-01 20:10:13 -07:00
Jean-Pierre Huynh 2b021f6760 MAINTAINER deprecation follow up. Relates to #25466
Signed-off-by: Jean-Pierre Huynh <jean-pierre.huynh@ounet.fr>

rewritten from github.com/moby/moby 2c435ab8beba93509b957e4ac5e5801b86b5e8f1
2018-06-01 20:10:13 -07:00
Aaron Lehmann b371d95625 Remove pkg/testutil/assert in favor of testify
I noticed that we're using a homegrown package for assertions. The
functions are extremely similar to testify, but with enough slight
differences to be confusing (for example, Equal takes its arguments in a
different order). We already vendor testify, and it's used in a few
places by tests.

I also found some problems with pkg/testutil/assert. For example, the
NotNil function seems to be broken. It checks the argument against
"nil", which only works for an interface. If you pass in a nil map or
slice, the equality check will fail.

In the interest of avoiding NIH, I'm proposing replacing
pkg/testutil/assert with testify. The test code looks almost the same,
but we avoid the confusion of having two similar but slightly different
assertion packages, and having to maintain our own package instead of
using a commonly-used one.

In the process, I found a few places where the tests should halt if an
assertion fails, so I've made those cases (that I noticed) use "require"
instead of "assert", and I've vendored the "require" package from
testify alongside the already-present "assert" package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>

rewritten from github.com/moby/moby 6052f2b3969feadb01662d8e2f30337d9c7f61af
2018-06-01 20:10:13 -07:00
Daniel Nephin 8ff2f7277c Refactor dockerfile parser
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 4cbc953a5d80c850df7107b28e743e933bbeb1d3
2018-06-01 20:10:13 -07:00
Daniel Nephin f36dfa3049 Cleanup processing of directives.
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 9c53fa2d0c1796d32aaba2193e7d802cd9b66763
2018-06-01 20:10:13 -07:00
Daniel Nephin 36fc03783a Keep parser.Directive internal to parser
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 64c4c1c3d5e0fe364d83db5a8dc99a24fd121754
2018-06-01 20:10:13 -07:00
Daniel Nephin 715c3b0ac6 Hide builder.parser.Directive internals
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby bb429da9a977a9d89121052fe1143528294b8a0c
2018-06-01 20:10:13 -07:00
Tonis Tiigi 6ac1bf9226 Add named context support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>

rewritten from github.com/moby/moby 87512bbc8490aca261133a7f3a3ea6518d703c34
2018-06-01 20:10:13 -07:00
Daniel Nephin 7510e5ed09 Fix --label being env var expanded.
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 434d77bc0edf21b970e0414ee54112768a490aaa
2018-06-01 20:10:13 -07:00
Daniel Nephin a284c4bbe2 Fix --label on docker build when a single quote is used in the value
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby 726fb269cf004814bd7065ca2f29f6955746a9d9
2018-06-01 20:10:13 -07:00
Daniel Nephin 2387678317 Refactor some builder code
Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby d7807c73169469c50e551704cc1957f798868f71
2018-06-01 20:10:13 -07:00
fate-grand-order e47bac49ce fix misspell in utils.go
Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>

rewritten from github.com/moby/moby 2b79dbc89bf15c276145a0fa3d3728308349f86e
2018-06-01 20:10:13 -07:00
fate-grand-order f3e2ff6cdf use t.Fatal() to output the err message where the values used for formatting
text does not appear to contain a placeholder

Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>

rewritten from github.com/moby/moby 2a8d6368d4a930203b93f75914173ab65bf3b0bc
2018-06-01 20:10:13 -07:00
Aaron.L.Xu ecb31e5da3 why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>

rewritten from github.com/moby/moby f8a40477960976f12dbbb72e5b133b5b0f05f9b3
2018-06-01 20:10:13 -07:00
Anthony Sottile b3d12d1e98 Remove unnecessary if in parser.Dump
Signed-off-by: Anthony Sottile <asottile@umich.edu>

rewritten from github.com/moby/moby 2283cd020373ebd00e5cf37a81df451349c3b506
2018-06-01 20:10:13 -07:00