Commit Graph

5991 Commits

Author SHA1 Message Date
Sebastiaan van Stijn deaf6e13ab
Bump Golang 1.11.4 (includes fix for CVE-2018-16875)
go1.11.4 (released 2018/12/14) includes fixes to cgo, the compiler, linker,
runtime, documentation, go command, and the net/http and go/types packages. It
includes a fix to a bug introduced in Go 1.11.3 that broke go get for import
path patterns containing "...".

See the Go 1.11.4 milestone for details:
https://github.com/golang/go/issues?q=milestone%3AGo1.11.4+label%3ACherryPickApproved

go1.11.3 (released 2018/12/14)

- crypto/x509: CPU denial of service in chain validation golang/go#29233
- cmd/go: directory traversal in "go get" via curly braces in import paths golang/go#29231
- cmd/go: remote command execution during "go get -u" golang/go#29230

See the Go 1.11.3 milestone on the issue tracker for details:
https://github.com/golang/go/issues?q=milestone%3AGo1.11.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 12:55:59 +01:00
Silvin Lubecki 283d8f95c8
Merge pull request #1579 from ijc/e2e-invocation-nit
e2e: assign a default value of 0 to `DOCKERD_EXPERIMENTAL`
2018-12-17 16:59:29 +01:00
Ian Campbell 4f483276cf e2e: assign a default value of 0 to `DOCKERD_EXPERIMENTAL`
Currently running the e2e tests produces a warning/error:

    $ make -f docker.Makefile test-e2e
    «...»
    docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker-cli-e2e
    ./scripts/test/e2e/run: line 20: test: : integer expression expected

This is from:

    test "${DOCKERD_EXPERIMENTAL:-}" -eq "1" && «...»

Where `${DOCKERD_EXPERIMENTAL:-}` expands to the empty string, resulting in
`test "" -eq "1"` which produces the warning. This error is enough to trigger
the short-circuiting behaviour of `&&` so the result is as expected, but fix
the issue nonetheless by provdiing a default `0`.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-12-17 14:32:38 +00:00
Sebastiaan van Stijn 298c423b57
Merge pull request #1558 from ijc/build-tweaks
Add a `fmt` build target and make use of a go build cache.
2018-12-17 12:49:59 +01:00
Sebastiaan van Stijn 7c514a31c9
Fix warnings not being printed on "create", only on "run"
Previously, these errors were only printed when using `docker run`, but were
omitted when using `docker container create` and `docker container start`
separately.

Given that these warnings apply to both situations, this patch moves generation
of these warnings to `docker container create` (which is also called by
`docker run`)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-13 14:21:34 +01:00
Sebastiaan van Stijn eb1b4b83c9
TestRunLabel: pass detach as argument
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-13 13:23:30 +01:00
Silvin Lubecki b9f150b17e
Merge pull request #1566 from thaJeztah/fix_panic_on_update
Fix panic (npe) when updating service limits/reservations
2018-12-13 09:47:31 +01:00
Sebastiaan van Stijn 579bb91853
Fix panic (npe) when updating service limits/reservations
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-13 02:21:57 +01:00
Sebastiaan van Stijn e5760891ab
Merge pull request #1565 from ahh-docker/extra_greater_than_7220
Removed extra  ">" in docs
2018-12-12 17:15:40 +01:00
Anne Henmi 4aecd8bda1 Fixed typo.
Signed-off-by: Anne Henmi <anne.henmi@docker.com>
2018-12-12 08:41:11 -07:00
Brian Goff 5d2a065886
Merge pull request #1545 from thaJeztah/bump_golang_1.11.2
Bump Go to 1.11.2
2018-12-11 05:13:34 -08:00
Ian Campbell d5de8358f0 Use a go build cache to speed up builds.
With a docker build cache already primed with the build image I am seeing
`time make build -f docker.Makefile DOCKER_BUILDKIT=1 GO_BUILD_CACHE=n` takes
more than 1 minute.

By contrast `time make build -f docker.Makefile DOCKER_BUILDKIT=1
GO_BUILD_CACHE=y` takes less than 10s with a hot cache irrespective of whether
the source tree has changed

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-12-11 11:19:46 +00:00
Sebastiaan van Stijn 58f0bfcf51
Bump Go to 1.11.2
go1.11.2 (released 2018/11/02) includes fixes to the compiler, linker,
documentation, go command, and the database/sql and go/types packages.

See the milestone on the issue tracker for details:
https://github.com/golang/go/issues?q=milestone%3AGo1.11.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-11 12:19:16 +01:00
Vincent Demeester cd0116f940
Merge pull request #1560 from tiborvass/filter-clone
prune: use filters.Args.Clone()
2018-12-11 08:55:44 +01:00
Vincent Demeester afcd368cea
Merge pull request #1537 from thaJeztah/whats_the_context
do not patch Dockerfiles in CI
2018-12-11 08:55:14 +01:00
Tibor Vass b991b6236a prune: use filters.Args.Clone()
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-12-10 16:48:59 +00:00
Ian Campbell 7c8ee78eaf build: Add a `fmt` target which runs `gofmt` on all files.
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-12-10 13:19:41 +00:00
Tibor Vass 1408a3189f
Merge pull request #1551 from thaJeztah/fix_filter_panic
Fix panic when pruning images with label-filter
2018-12-10 13:21:37 +01:00
Sebastiaan van Stijn a0fe333cab
Merge pull request #1546 from albers/completion-import--platform
Add bash completion for `import --platform`
2018-12-07 20:07:49 +01:00
Sebastiaan van Stijn 687cf9bef7
Merge pull request #1547 from albers/completion-log-driver-local
Add bash completion for "local" log driver
2018-12-07 20:04:09 +01:00
Sebastiaan van Stijn 1e1dd5bca4
Fix panic when pruning images with label-filter
Before this change:

    docker image prune --force --filter "label=foobar"
    panic: assignment to entry in nil map

    goroutine 1 [running]:
    github.com/docker/cli/vendor/github.com/docker/docker/api/types/filters.Args.Add(...)
    /go/src/github.com/docker/cli/vendor/github.com/docker/docker/api/types/filters/parse.go:167
    github.com/docker/cli/cli/command/image.runPrune(0x1db3a20, 0xc000344cf0, 0x16e0001, 0xc00015e600, 0x4, 0x3, 0xc00024e160, 0xc000545c70, 0x5ab4b5)
    /go/src/github.com/docker/cli/cli/command/image/prune.go:79 +0xbaf
    github.com/docker/cli/cli/command/image.NewPruneCommand.func1(0xc00029ef00, 0xc0004a8180, 0x0, 0x3, 0x0, 0x0)
    /go/src/github.com/docker/cli/cli/command/image/prune.go:32 +0x64
    github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc00029ef00, 0xc000038210, 0x3, 0x3, 0xc00029ef00, 0xc000038210)
    /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:762 +0x473
    github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000127180, 0xc000272770, 0x1836ce0, 0xc000272780)
    /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
    github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(0xc000127180, 0xc000127180, 0x1d60880)
    /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:800 +0x2b
    main.main()
    /go/src/github.com/docker/cli/cmd/docker/docker.go:180 +0xdc

With this patch applied:

    docker image prune --force --filter "label=foobar"
    Total reclaimed space: 0B

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-07 17:56:31 +01:00
Harald Albers 561f6e399c
Merge pull request #1130 from cyphar/separate-domainname-flag
cli: add a separate --domainname flag
2018-12-07 16:07:53 +01:00
Aleksa Sarai 647579068f
cli: add a separate --domainname flag
A while ago, Docker split the "Domainname" field out from the "Hostname"
field for the container configuration. There was no real user-visible
change associated with this (and under the hood "Domainname" was mostly
left unused from the command-line point of view). We now add this flag
in order to match other proposed changes to allow for setting the NIS
domainname of a container.

This also includes a fix for the --hostname parsing tests (they would
not error out if only one of .Hostname and .Domainname were incorrectly
set -- which is not correct).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2018-12-08 00:03:56 +11:00
Sebastiaan van Stijn d8479b4238
Merge pull request #1548 from ZYecho/fix-images-filter
fix: add more details about multiple images filter
2018-12-07 11:26:56 +01:00
zhangyue 012e05bdd4 fix: add more details about multiple images filter
Signed-off-by: zhangyue <zy675793960@yeah.net>
2018-12-05 12:04:06 +08:00
Harald Albers c59038b15c Add bash completion for "local" log driver
Ref: https://github.com/moby/moby/pull/37092

Also adds log-opt `compress` to json-file log driver because this was
also added in the referenced PR.

Signed-off-by: Harald Albers <github@albersweb.de>
2018-12-02 19:07:19 +01:00
Harald Albers e0fe546c37 Add bash completion for `import --platform`
Signed-off-by: Harald Albers <github@albersweb.de>
2018-12-01 23:30:30 +01:00
Andrew Hsu 504cecf293
Merge pull request #1539 from thaJeztah/fix_flags_in_usage
Fix yamldocs outputing `[flags]` in usage output
2018-11-29 13:29:41 -08:00
Sebastiaan van Stijn 1f6a1a438c
Merge pull request #1252 from albers/completion-cli-experimental
Add bash completion for experimental CLI commands (manifest)
2018-11-29 17:11:28 +01:00
Sebastiaan van Stijn 44d96e9120
Fix yamldocs outputing `[flags]` in usage output
A similar change was made in the CLI itself, but is not
inherited by the code that generates the YAML docs.

Before this patch is applied;

```
usage: docker container exec [OPTIONS] CONTAINER COMMAND [ARG...] [flags]
```

With this patch applied:

```
usage: docker container exec [OPTIONS] CONTAINER COMMAND [ARG...]
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-29 15:39:07 +01:00
Sebastiaan van Stijn 166856ab1b
Do not patch Dockerfiles in CI
When building the Dockerfiles for development, those images are mainly used to
create a reproducible build-environment. The source code is bind-mounted into
the image at runtime; there is no need to create an image with the actual
source code, and copying the source code into the image would lead to a new
image being created for each code-change (possibly leading up to many "dangling"
images for previous code-changes).

However, when building (and using) the development images in CI, bind-mounting
is not an option, because the daemon is running remotely.

To make this work, the circle-ci script patched the Dockerfiles when CI is run;
adding a `COPY` to the respective Dockerfiles.

Patching Dockerfiles is not really a "best practice" and, even though the source
code does not and up in the image, the source would still be _sent_ to the daemon
for each build (unless BuildKit is used).

This patch updates the makefiles, circle-ci script, and Dockerfiles;

- When building the Dockerfiles locally, pipe the Dockerfile through stdin.
  Doing so, prevents the build-context from being sent to the daemon. This speeds
  up the build, and doesn't fill up the Docker "temp" directory with content that's
  not used
- Now that no content is sent, add the COPY instructions to the Dockerfiles, and
  remove the code in the circle-ci script to "live patch" the Dockerfiles.

Before this patch is applied (with cache):

```
$ time make -f docker.Makefile build_shell_validate_image
docker build -t docker-cli-shell-validate -f ./dockerfiles/Dockerfile.shellcheck .
Sending build context to Docker daemon     41MB
Step 1/2 : FROM    debian:stretch-slim
...
Successfully built 81e14e8ad856
Successfully tagged docker-cli-shell-validate:latest

2.75 real         0.45 user         0.56 sys
```

After this patch is applied (with cache)::

```
$ time make -f docker.Makefile build_shell_validate_image
cat ./dockerfiles/Dockerfile.shellcheck | docker build -t docker-cli-shell-validate -
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM    debian:stretch-slim
...
Successfully built 81e14e8ad856
Successfully tagged docker-cli-shell-validate:latest

0.33 real         0.07 user         0.08 sys
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-29 10:44:14 +01:00
Vincent Demeester f64dc97aca
Merge pull request #1306 from cyphar/obey-source_date_epoch
man: obey SOURCE_DATE_EPOCH when generating man pages
2018-11-29 09:49:44 +01:00
Sebastiaan van Stijn 1f61ced7b3
Merge pull request #1536 from nirs/environmental
Replace environmental with environment
2018-11-29 02:33:38 +01:00
Nir Soffer f1f3d3be17 Replace environmental with environment
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2018-11-29 01:34:12 +02:00
Silvin Lubecki 69bd2728c4
Merge pull request #1509 from selansen/master
Data Path Port configuration support
2018-11-28 17:10:39 +01:00
selansen e3e976a82a Data Path Port configuration support
This PR chnages allow user to configure data path
port number. By default we use 4789 port number. But this commit
will allow user to configure port number during swarm init.
Data path port can't be modified after swarm init.

Signed-off-by: selansen <elango.siva@docker.com>
2018-11-28 10:55:42 -05:00
selansen 052133a4f5 Vendor commit for Data Path Port configuration support
This commit brings Swarmkit and docker chnages

Signed-off-by: selansen <elango.siva@docker.com>
2018-11-26 15:58:44 -05:00
Sebastiaan van Stijn 2d692aedb3
Merge pull request #1517 from glefloch/migrate-test-from-moby
Migrate TestTrustedCreateFromBadTrustServer from moby into cli/e2e
2018-11-26 17:09:40 +01:00
glefloch 37679bfc85 Add missing test
Signed-off-by: glefloch <glfloch@gmail.com>
2018-11-26 14:02:16 +00:00
Sebastiaan van Stijn e042b58f7d
Merge pull request #1527 from tiborvass/fix-system-prune-filters
prune: move image pruning before build cache pruning
2018-11-21 19:01:48 +01:00
Sebastiaan van Stijn e1d28fad2d
Merge pull request #1493 from tonistiigi/buildkit-docs-update
add more buildkit docs
2018-11-21 17:10:33 +01:00
Tonis Tiigi 83aeb219f0
buildkit reference docs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-21 16:41:33 +01:00
Silvin Lubecki 5931fb4276
Merge pull request #1528 from thaJeztah/add_logging_driver_example
Update daemon.json example to show that log-opts must be a string
2018-11-21 14:56:14 +01:00
Sebastiaan van Stijn fd33e0d933
Update daemon.json example to show that log-opts must be a string
log-opts are passed to logging-drivers as-is, so the daemon is not
aware what value-type each option takes.

For this reason, all options must be provided as a string, even if
they are used as numeric values by the logging driver.

For example, to pass the "max-file" option to the default (json-file)
logging driver, this value has to be passed as a string;

```json
{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}
```

When passed as a _number_ (`"max-file": 3`), the daemon will invalidate
the configuration file, and fail to start;

    unable to configure the Docker daemon with file /etc/docker/daemon.json: json: cannot unmarshal number into Go value of type string

This patch adds an example to the daemon.json to show these  values
have to be passed as strings.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-21 13:26:08 +01:00
Tibor Vass 6c10abb247 prune: move image pruning before build cache pruning
This is cleaner because running system prune twice in a row
now results in a no-op the second time.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-11-21 05:33:36 +00:00
Silvin Lubecki 422baf69f6
Merge pull request #1523 from sudo-bmitch/pr-doc-cmd-entrypoint
Documenting ENTRYPOINT can empty value of CMD
2018-11-20 15:47:34 +01:00
Brandon Mitchell cc316fde55 Documenting ENTRYPOINT can empty value of CMD
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2018-11-17 10:10:15 -05:00
Sebastiaan van Stijn f7ea8e831b
Merge pull request #1521 from albers/completion-fix-service--force
Fix bash completion for `service update --force`
2018-11-15 18:15:32 +01:00
Harald Albers 5fa5eb1da6 Fix bash completion for `service update --force`
- `--force` is not available in `service create`
- `--force` is a boolean option

Signed-off-by: Harald Albers <github@albersweb.de>
2018-11-15 13:43:58 +01:00
Sebastiaan van Stijn 29625f6124
Merge pull request #1415 from dhiltgen/fix_panic_master
Fix panic in display only case for license - forward port #1408 to master
2018-11-15 00:55:48 +01:00