Commit Graph

281 Commits (785436a312230fcc79b41aa044c1643528c91913)

Author SHA1 Message Date
Tonis Tiigi 946a12eb42 gateway: expose worker information
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:39 -07:00
Tonis Tiigi 90d164ced5 gateway: inital caps detection support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:38 -07:00
Tonis Tiigi ae1127be14 frontend: define default caps
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:38 -07:00
Tonis Tiigi db5b0f1b9a api: add caps support for versioning
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:34 -07:00
Tõnis Tiigi cda0a64eca
Merge pull request #486 from AkihiroSuda/update-rootless
rootless: refactor libcontainer_specconv & add integration tests
2018-07-05 11:26:26 -07:00
Tõnis Tiigi c111113a2f
Merge pull request #278 from AkihiroSuda/cache-transferable
decouple remotecache from Docker registry
2018-07-05 11:18:50 -07:00
Yuichiro Kaneko b5c66082a1 Fix orders of `require.Equal` argument to "expected, actual"
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-04 21:59:37 +09:00
Akihiro Suda 580dbe08b9 rootless: add integration tests
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-07-04 19:27:54 +09:00
Akihiro Suda 80d2f820f9 decopule cache/remotecache from registry
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-07-04 17:38:09 +09:00
Yuichiro Kaneko 30c27cd6bf Return an error when copying from url
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-03 20:28:08 +09:00
Yuichiro Kaneko ec798d6b09 Update documents of `AddCommand`
`ADD` does not support git.

Ref: https://github.com/moby/moby/issues/14704#issuecomment-298134333

Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-03 09:25:30 +09:00
Yuichiro Kaneko b8bf5d0da9 Refactoring `toCommand` and `detectRunMount` to only depend to `dispatchStates`
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-03 07:38:34 +09:00
Yuichiro Kaneko 0d5c12363a Introduce `dispatchStates` type
`dispatchStates` manages a collection of `dispatchState`.
By `dispatchStates`, we can aggregate how to find `dispatchState`
in one place and `dispatchStatesByName` local variable in `Dockerfile2LLB`
can be removed.

Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-03 07:36:07 +09:00
Yuichiro Kaneko fdfa7b8431 Add description about Unix
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-01 00:08:35 +09:00
Yuichiro Kaneko a448c8f3fb Fix a typo
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-06-30 11:20:33 +09:00
Anda Xu 7f64188f17 add missing supplementary group IDs
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-06-29 18:50:03 -07:00
Tõnis Tiigi 3b9737dd5a
Merge pull request #470 from yui-knk/ensure_arg_is_not_blank
Ensure BaseName of Stage is not blank
2018-06-28 10:32:11 -07:00
Yuichiro Kaneko 813575f62a Ensure BaseName of Stage is not blank
Related: https://github.com/moby/moby/issues/37325

Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-06-28 20:21:41 +09:00
Akihiro Suda cce2080ddb
Merge pull request #468 from tonistiigi/update-containerd
vendor: update containerd to 08f7ee982
2018-06-27 14:37:47 +09:00
Tonis Tiigi 97abda7528 dockerfile: use manifest list copy image
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-26 21:22:32 -07:00
Tonis Tiigi 5dea4ade69 dockerfile: allow setting target platform with opts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-26 21:14:52 -07:00
Tonis Tiigi 65e6d4d21a dockerfile: allow autodetect platform from image config
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-26 10:42:30 -07:00
Tonis Tiigi e618878451 dockerfile: platform support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-25 11:06:08 -07:00
Tonis Tiigi f9383c48a3 source: image source platform support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-25 10:39:17 -07:00
Tonis Tiigi dc9de85069 llb: force platform in llb and allow constraints
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-22 16:49:03 -07:00
Akihiro Suda b36d2dc272
Merge pull request #459 from tonistiigi/optional-digest
gateway: allow digest to be optional
2018-06-21 08:42:42 +09:00
Tonis Tiigi bdb77f073a gateway: protect gateway forwarder map access
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-20 11:17:05 -07:00
Tonis Tiigi e5449521f5 gateway: allow digest to be optional
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-20 11:09:32 -07:00
Akihiro Suda cfe4e19158
Merge pull request #455 from tonistiigi/cache-sharing
llbsolver: allow sharing modes for cache mounts
2018-06-21 00:17:05 +09:00
Tonis Tiigi cdcab49bfc dockerfile: expose cache sharing options
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-19 15:57:25 -07:00
Tonis Tiigi ccbf185006 llbsolver: allow sharing modes for cache mounts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-19 15:57:20 -07:00
Tonis Tiigi 941407f6c0 dockerfile: escape git regexp
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-18 11:26:07 -07:00
Akihiro Suda 00140b7992
Merge pull request #440 from ijc/configurable-client-timeout
client: take a context.Context to New().
2018-06-15 16:08:33 -07: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
Ian Campbell 97ffd6cce8 client: take a context.Context to New().
This allows two things:

- The caller to set a shorter timeout than previously hardcoded 30s. In
  `buildctl` reduce the timeout to 5s. Since the existing timeout has gone
  callers will need to arrange to pass one themselves.
- The caller can arrange for the context to be cancelled for other reasons, use
  this in `buildctl` to plumb through the Ctrl-C handling, meaning that
  `buildctl` now exits almost immediately on Ctrl-C instead of after several
  seconds.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-11 14:28:08 +01:00
Tõnis Tiigi 704a40048b
Merge pull request #448 from tiborvass/update-copy-image
dockerfile: update copy image to v0.1.3
2018-06-08 20:06:17 -07:00
Tibor Vass eb44845441 dockerfile: update copy image to v0.1.3
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-09 02:49:34 +00:00
Tonis Tiigi 6f569455d0 dockerfile: enable tmpfs mounts on run —mount
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-08 13:42:38 -07:00
Akihiro Suda 60344aa592
Merge pull request #442 from tonistiigi/runmount
dockerfile: add run --mount support
2018-06-09 02:35:34 +09:00
Tõnis Tiigi 7943598281
Merge pull request #439 from AkihiroSuda/vendor-containerd-20180606
update containerd library
2018-06-08 10:33:10 -07:00
Akihiro Suda 47a00b84fe update containerd library
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-06-08 21:44:17 +09:00
Tonis Tiigi af03a526e7 dockerfile: run -—mount initial support
Supports binds from images and context and cache mounts.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-07 16:23:40 -07:00
Tonis Tiigi aeea615e85 dockerfile: add run mount parsing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-07 14:55:13 -07:00
Tonis Tiigi 103cd072d6 dockerfile: detect source symlinks with targets
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-05 23:54:13 -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
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
Justin Cormack cd0e0661bb Remove sqlite
This drops support for migrations from pre-1.10 Docker versions, which
should be done via an external tool or an intermediate upgrade.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>

rewritten from github.com/moby/moby f8119bb7a76b5c42defb6e0a2dc67bd77ad29a5e
2018-06-01 20:10:13 -07:00
Sebastiaan van Stijn 02c53c03f2 Revert "Require continuation char to be last char in a line"
This reverts commit 105bc63295a7126798d3722a0e205c5ead4e2b1c,
which (although correct), resulted in a backward incompatible
change.

We can re-implement this in future, after this changes goes
through a deprecation cycle

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

rewritten from github.com/moby/moby c67550414b762ab32ea3e9645ebcafb79cb9059d
2018-06-01 20:10:13 -07:00
Vincent Demeester abafb74cda Revert "Fix dockerfile parser with empty line after escape"
This reverts commit 3e1b539e8d0ed4abf695b0a8c42346fba6d5a6b0.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

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