Commit Graph

1126 Commits (936aa64061d7f42fc246859fcf20222a6ffb7059)

Author SHA1 Message Date
Nao YONASHIRO 28fc483de0 client: use grpc.DialContext and context.WithTimeout instead of grpc.WithTimeout
Currently, grpc.WithTimeout is deprecated.
2018-06-05 17:34:49 +09:00
Tõnis Tiigi a80e6eba25
Merge pull request #433 from tonistiigi/hack-mitigation
hack: mitigate bug in old docker version
2018-06-05 00:14:54 -07:00
Tõnis Tiigi ad20ed1fe3
Merge pull request #430 from tonistiigi/update-fsutil
vendor: update fsutil to 30b4fcc5
2018-06-04 23:59:35 -07:00
Tonis Tiigi 347b6a3d74 hack: mitigate bug in old docker version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-04 23:54:44 -07:00
Tõnis Tiigi 43e758232a
Merge pull request #422 from thaJeztah/update_microsoft_vendors
Update containerd and dependencies
2018-06-04 10:37:46 -07:00
Tõnis Tiigi 4bfa5b37f9
Merge pull request #427 from AkihiroSuda/rootless-dockerfile
test.Dockerfile: new target: "rootless"
2018-06-04 10:33:28 -07:00
Sebastiaan van Stijn b5028a234b
Update containerd and dependencies
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-04 10:14:06 -07:00
Vincent Demeester a7b7594339
Merge pull request #428 from tomwillfixit/patch-1
Small typo
2018-06-04 16:32:56 +02:00
Akihiro Suda 18ac6e2d9a test.Dockerfile: new target: "rootless"
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-06-04 23:17:03 +09:00
Thomas Shaw 98ed3a531c
Small typo 2018-06-04 15:14:08 +01:00
Tõnis Tiigi b14fd548fe
Merge pull request #426 from AkihiroSuda/wrap-mount-err
snapshot: wrap mount err
2018-06-02 09:19:59 -07:00
Akihiro Suda c2a35a5c6f
Merge pull request #425 from tonistiigi/include-dockerfile-parser
dockerfile: move helper packages
2018-06-02 15:48:34 +09:00
Tonis Tiigi e33d2ac17c contenthash: normalize symlink mode
Mode is not implemented in platform compatible way
so normalize when calculating the checksum.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-01 23:34:51 -07:00
Akihiro Suda 1269bc5682 snapshot: wrap mount err
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-06-02 15:33:26 +09:00
Tonis Tiigi b590c0d970 vendor: update fsutil to 30b4fcc5
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-01 23:09:38 -07:00
Tonis Tiigi a4bc39542f vendor: add missing test dependencies
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-01 20:13:46 -07: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 7d6f79781d Handle multi-digit positional parameters
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

rewritten from github.com/moby/moby 2628896b5e813491f8767ec7fa9d0f057ed4a86e
2018-06-01 20:10:13 -07:00
Sebastiaan van Stijn 13cd59db64 Add detection of "special parameters" for substitution
Detect Special parameters as defined in
http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_05_02

Treat these as parameters that are not set, instead of
producing an error that a modifier is missing.

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

rewritten from github.com/moby/moby 9654e9b6f80e1b931763c04400a19596e256c99a
2018-06-01 20:10:13 -07:00
Sebastiaan van Stijn cd7c16b606 Add more test-cases for positional parameters
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

rewritten from github.com/moby/moby 8687a3f4b8b7ffbc3f32dfe959cb771d662211e6
2018-06-01 20:10:13 -07:00
Sebastiaan van Stijn 5e7c39f879 Add line-numbers to asserts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

rewritten from github.com/moby/moby b80e0309d220268a2b9e6aec5bb05d7af330e591
2018-06-01 20:10:13 -07:00
Sebastiaan van Stijn e15e0ddbf5 Fix detection for missing parameter in substitution
`${}`, `${:}` and so on are invalid because there's
no parameter within the brackets; fix detection for
this situation and add/update tests.

There were some existing test-cases that were testing
for the wrong behavior, which are now updated.

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

rewritten from github.com/moby/moby 334bf3ea76004d0abe02dd1698989f9eaf87a86a
2018-06-01 20:10:13 -07:00
Sebastiaan van Stijn 33114da1da builder: fix processing of invalid substitusion syntax
The builder did not detect syntax errors in substitusions in the
Dockerfile, causing those values to be processed incorrectly instead of
producing an error.

Example 1: missing `}`

    docker build --no-cache -<<'EOF'
    FROM busybox
    ARG var=${aaa:-bbb
    RUN echo $var
    EOF

Before:

    Step 3/3 : RUN echo $var
     ---> Running in f06571e77146
    bbb

After:

    Step 2/3 : ARG var=${aaa:-bbb
    failed to process "${aaa:-bbb": syntax error: missing '}'

Example 2: missing closing `}`, no default value

    docker build --no-cache -<<'EOF'
    FROM busybox
    ARG var=${aaa
    RUN echo $var
    EOF

Before:

    Step 2/3 : ARG var=${aaa
    failed to process "${aaa": missing ':' in substitution

After:

    Step 2/3 : ARG var=${aaa
    failed to process "${aaa": syntax error: missing '}'

Example 3: double opening bracket (`{`)

    docker build --no-cache -<<'EOF'
    FROM busybox
    ARG var=${{aaa:-bbb}
    RUN echo $var
    EOF

Before:

    Step 2/3 : ARG var=${{aaa:-bbb}
    failed to process "${{aaa:-bbb}": missing ':' in substitution

After:

    Step 2/3 : ARG var=${{aaa:-bbb}
    failed to process "${{aaa:-bbb}": syntax error: bad substitution

Example 4: double opening bracket (`{`), no default value

    docker build --no-cache -<<'EOF'
    FROM busybox
    ARG var=${{aaa}
    RUN echo $var
    EOF

Before:

    Step 2/3 : ARG var=${{aaa}
    failed to process "${{aaa}": missing ':' in substitution

After:

    Step 2/3 : ARG var=${{aaa}
    failed to process "${{aaa}": syntax error: bad substitution

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

rewritten from github.com/moby/moby 955a6ad95f7891a45692d975793abf1eeb07cdd5
2018-06-01 20:10:13 -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
Sebastiaan van Stijn 5d7a878e53 Replace deprecated testutil.ErrorContains()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

rewritten from github.com/moby/moby 55bebbaecf5e40db9d83b28080ce08dc8642f407
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
Dennis Chen c35701d68d Add 'LABEL' command from '--label' to the last stage
This PR is tring to fix issue #36996.

Currently for multi-stage build, if `--target` specified, the `--label` option
will be ignored. The root cause is the last stage build will remove the `LABEL`
command(s) node created from the `--label` option. In order to address this issue,
we can create `LABEL` command(s) and add it/tem to the last stage.

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

rewritten from github.com/moby/moby 9c238ebd55e4105ad7f7edc04231ea61bb278ae8
2018-06-01 20:10:13 -07:00
Dennis Chen 29887cc5b2 Fix the target name issue for multi-stage build
This PR is trying to fix issue #36956.

The stage name is case-insensitive by design, so we should use
`strings.EqualFold()` as the comparison method to eliminate the
case sensitive noise.

Also we need to return a pre-defined error code order to avoid below
message like:
"FIXME: Got an API for which error does not match any expected type!!!:
failed to reach build target dev in Dockerfile"

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

rewritten from github.com/moby/moby 7c0570473cfa181aeb3278072cc9af4f9298cb98
2018-06-01 20:10:13 -07:00
John Howard 668e4abfbb Builder: Review feedback
Signed-off-by: John Howard <jhoward@microsoft.com>

rewritten from github.com/moby/moby 14429056d3745ca052fba448d879788d16bbb01b
2018-06-01 20:10:13 -07:00
John Howard 354aaeb223 Builder: Plumbing through platform in `FROM` statement
Signed-off-by: John Howard <jhoward@microsoft.com>

rewritten from github.com/moby/moby 69fa84bc3d57dafd19800642c5ba196bc6d45f90
2018-06-01 20:10:13 -07:00
John Howard 0381374837 Builder - add --platform to FROM statement
Signed-off-by: John Howard <jhoward@microsoft.com>

rewritten from github.com/moby/moby 7f0c2d23e11485c7f026dd8c111c60c2e1e03375
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
bin liu 0873a108bb Fix typos in builder and client
Signed-off-by: bin liu <liubin0329@gmail.com>

rewritten from github.com/moby/moby ce0993270436c16a17e0afb08b9130556346b983
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
Matt Rickard 1f5fd4bb26 Move builder shell parser into subpackage
Moves builder/shell_parser and into its own subpackage at builder/shell since it
has no dependencies other than the standard library. This will make it
much easier to vendor for downstream libraries, without pulling all the
dependencies of builder/.

Fixes #36154

Signed-off-by: Matt Rickard <mrick@google.com>

rewritten from github.com/moby/moby a634526d14639c6b98c509a069ef29e2b69c0ef0
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
Ri Xu 182b2d5bd6 Typo fixed and simple code.
Signed-off-by: Ri Xu <xuri@360.net>

rewritten from github.com/moby/moby 87e8a936e82ecfbef59b829d8bbfca3fb4aa3163
2018-06-01 20:10:13 -07:00
John Howard ff49463d78 Fix TestErrorCases to run all tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>

rewritten from github.com/moby/moby d2c41f06c36dc24b2170fef365563d64cc5bd8ec
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
Sebastiaan van Stijn 3b355e7083 Improve error message for COPY missing destination
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

rewritten from github.com/moby/moby 5d05a8291314b8f727b04b504b8d7fc7ed7f42da
2018-06-01 20:10:13 -07:00
Simon Ferquel 8cde317b4c Introduce a typed command system and 2 phase parse/dispatch build
This is a work base to introduce more features like build time
dockerfile optimisations, dependency analysis and parallel build, as
well as a first step to go from a dispatch-inline process to a
frontend+backend process.

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>

rewritten from github.com/moby/moby 669c0677980b04bcbf871bb7c2d9f07caccfd42b
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