With this patch, the `--progress`, `--secret`, `--ssh`, and `--output` flags
trigger an error when trying to use without BuildKit enabled;
DOCKER_BUILDKIT=0 docker build --progress=plain .
--progress is only supported with BuildKit enabled. Enable BuildKit with DOCKER_BUILDKIT=1
DOCKER_BUILDKIT=0 docker build --output=foo .
--output is only supported with BuildKit enabled. Enable BuildKit with DOCKER_BUILDKIT=1
Likewise, options that are not supported yet by BuildKit, now trigger an error:
DOCKER_BUILDKIT=1 docker build --memory=500M .
--memory is not supported with BuildKit enabled. Disable BuildKit with DOCKER_BUILDKIT=0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This hack was added in an attempt to continue supporting the experimental
(non-buildkit) `--platform` option, by dynamically updating the API version
required if buildkit isn't enabled.
This hack didn't work, however, because at the moment the override is
added, the command is not yet attached to the "root" (`docker`) command,
and because of that, the command itself is the `root` command;
`cmd.Root()` returned the `build` command.
As a result, validation steps defined as `PersistentPreRunE` on the root
command were not executed, causing invalid flags/options to not producing
an error.
Attempts to use an alternative approach (for example, cobra supports both
a `PersistentPreRun` and `PersistentPreRunE`) did not work either, because
`PersistentPreRunE` takes precedence over `PersistentPreRun`, and only one
will be executed.
Now that `--platform` should be supported for other cases than just for
experimental (LCOW), let's remove the 'experimental' check, and just assume
it's supported for API v1.32 and up.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
diffs and relevant changes:
docker/docker: c2cc352355...af34b94a78
- replace pkg/symlink with github.com/moby/sys/symlink
moby/sys: 6154f11e68...1bc8673b57
changes:
- mount, mountinfo: Add support for OpenBSD in addition to FreeBSD
- mount, mountinfo: Exclude macOS (darwin)
- mount.RecursiveUnmount(): minor improvements
- mount.RecursiveUnmount: add a fast path
- mount: bump mountinfo to v0.3.1
- mount: Some refactor and improved GoDoc about Windows support
- mount: use MNT_* flags from golang.org/x/sys/unix on freebsd (reduces use of cgo)
- mountinfo.Mounted: add fast path for Linux using openat2
- mountinfo.Mounted: optimize by adding fast paths
- mountinfo: correctness improvements
- mountinfo: deprecate PidMountInfo
- mountinfo: fix not showing package doc, typos
- mountinfo: fix path unescaping
- mountinfo: make GetMountinfoFromReader Linux-specific
- mountinfo: rename FstypeFilter -> FSTypeFilter, fix FilterFunc docs
- mountinfo: use idiomatic naming for fields
- Migrate github.com/docker/docker/pkg/symlink
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
To create this, I ran every JSON document through `jq -S` (which sorts the keys and consistently pretty-prints the result in a format which matches the majority of documents in this file).
Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
full diff: 73f35e472e...7f0af18e79
- update gotest.tools to v3
- Use unix.Ioctl{Get,Set}Termios on all unix platforms
- Make Termios type alias, remove casts
vendor: golang.org/x/sys eeed37f84f13f52d35e095e8023ba65671ff86a1
ed371f2e16...eeed37f84f
- all: add GOOS=ios
- unix: add back IoctlCtlInfo on darwin
- windows: add SetConsoleCursorPosition
- unix: update Dockerfile to Linux 5.9 and Go 1.15.2 (adds `CAP_CHECKPOINT_RESTORE`)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Docker v17.07 introduced an experimental `--stream` flag on `docker build` which
allowed the build-context to be incrementally sent to the daemon, instead of
unconditionally sending the whole build-context.
This functionality has been reimplemented as part of BuildKit, which uses streaming
by default and the `--stream` option will be ignored when using the classic builder,
printing a deprecation warning instead.
Users that want to use this feature are encouraged to enable BuildKit by setting
the `DOCKER_BUILDKIT=1` environment variable or through the daemon or CLI configuration
files.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
While performance will be worse, we can safely ignore the --stream
option when used, and print a deprecation warning instead of failing
the build.
With this patch:
echo -e "FROM scratch\nLABEL foo=bar" | docker build --stream -
DEPRECATED: The experimental --stream flag has been removed and the build context
will be sent non-streaming. Enable BuildKit instead with DOCKER_BUILDKIT=1
to stream build context, see https://docs.docker.com/go/buildkit/
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM scratch
--->
Step 2/2 : LABEL foo=bar
---> Running in 99e4021085b6
Removing intermediate container 99e4021085b6
---> 1a7a41be241f
Successfully built 1a7a41be241f
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Caught by CodeQL:
> Incorrect conversion of an integer with architecture-dependent bit size
> from strconv.ParseUint to a lower bit size type uint16 without an upper
> bound check.
fixes https://github.com/docker/cli/security/code-scanning/2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
While running a plugin and canceling with SIGTERM, main process will
close right away without letting the plugin close itself down and handle
the exit code properly. Add appcontext that is useful for handling
sigterm, as well as supporting sigkill when things go wrong.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
full diff: https://github.com/gofrs/flock/compare/v0.7.1...v0.7.3
Relevant changes:
- fix: close/Unlock won't close the file descriptor if not locked
- fix license text, update year
Note that there's also a v0.8.0 release; that release only adds aix support,
which is currently of no interest to us, so skipping that version for now.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>