Commit Graph

660 Commits

Author SHA1 Message Date
5c8fdca78f Add expanded port syntax to Compose schema and types.
This commit adds expanded port syntax to Compose schema and types
so that it is possible to have
```
ports:
  - mode: host
    target: 80
    published: 9005
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 60c1eaf8f08f904248cbfa0d07d850025a35e6d0
Component: engine
2017-02-07 09:12:55 -08:00
770410c730 Merge pull request #30749 from yongtang/28005-docker-stats-header-windows
Fix Windows `docker stats` showing Linux headers
Upstream-commit: 90709776c5a78bcfab226c19ccb6fa21c3f272f6
Component: engine
2017-02-06 14:09:23 -08:00
f29b0ab9bd Merge pull request #30742 from yongtang/29975-compose-network-attachable
Add compose support of `attachable` in networks
Upstream-commit: e06ae6f41955acad6f614f9e88b79672862ec26c
Component: engine
2017-02-06 12:27:44 -08:00
7942fcb4f0 Merge pull request #30769 from tianon/prompt-for-confirmation
Fix "command.PromptForConfirmation" to accept "enter" for the "N" default
Upstream-commit: d4136eb5251132f4b841fd74fa8a0d74c156069e
Component: engine
2017-02-06 11:44:45 -08:00
3b3c271a31 Fix "command.PromptForConfirmation" to accept "enter" for the "N" default
This adjusts `command.PromptForConfirmation` in `cli/command/utils.go` to use `bufio`'s `ReadLine` rather than using `fmt.Fscan` for reading input, which makes `<Enter>` properly accept the default value of "No" as one would expect.

This new code actually came from `cli/command/plugin/install.go`'s `acceptPrivileges` function, which I've also refactored here to use `command.PromptForConfirmation` as it should.

Additionally, this updates `cli/command/plugin/upgrade.go`'s `runUpgrade` function to use `command.PromptForConfirmation` for further consistency.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 2198b0568f7b7137545757c896191ef2a2bc720e
Component: engine
2017-02-06 09:13:07 -08:00
190522d7df Fix Windows docker stats showing Linux headers
This fix is an attempt to fix issue raised in #28005 where
`docker stats` on Windows shows Linux headers if there is
no containers in stats.

The reason for the issue is that, in case there is no container,
a header is faked in:
https://github.com/docker/docker/blob/v1.13.0/cli/command/formatter/formatter.go#L74-L78
which does not know OS type information (as OS was stored with container stat entries)

This fix tries to fix the issue by moving OS type information
to stats context (instead of individual container stats entry).

Additional unit tests have been added.

This fix fixes #28005.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 0a3a3ba2b62a5720d949e93fd580d3cf797cfa9e
Component: engine
2017-02-05 08:55:30 -08:00
a86724bb15 Add compose support of attachable in networks
This fix tries to address the issue raised in 29975 where
it was not possible to specify `attachable` flag for networks
in compose format.

NOTE: Compose format aleady supports `labels` in networks.

This fix adds the support of `attachable` for compose v3.1 format.

Additiona unit tests have been updated and added.

This fix fixes 29975.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: cf4b7a5b876cfa91a1bea22d248e4925c8e2bf71
Component: engine
2017-02-04 14:16:06 -08:00
a3638a3c5b Merge pull request #28751 from ijc25/wrap-help-output
Wrap CLI --help output to terminal width
Upstream-commit: fac13e4e0764c551c5452e6f8fbcde45cf67ff12
Component: engine
2017-02-03 23:04:11 -08:00
28da29ca6e Add docker plugin upgrade
This allows a plugin to be upgraded without requiring to
uninstall/reinstall a plugin.
Since plugin resources (e.g. volumes) are tied to a plugin ID, this is
important to ensure resources aren't lost.

The plugin must be disabled while upgrading (errors out if enabled).
This does not add any convenience flags for automatically
disabling/re-enabling the plugin during before/after upgrade.

Since an upgrade may change requested permissions, the user is required
to accept permissions just like `docker plugin install`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 03c694973968f63743ed53cef83d0b7455695081
Component: engine
2017-02-03 16:21:12 -05:00
6beb277937 Wrap output of docker cli --help
This should go some way to unblocking a solution to #18797, #18385 etc by
removing the current rather restrictive constraints on help text length.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Upstream-commit: a4f71ccff6a99b39c01e3743d0b0cc4316b33b8d
Component: engine
2017-02-03 11:05:49 +00:00
c16190c838 Merge pull request #30180 from allencloud/add-endpoint-mode-a-default-value
add endpoint mode a default value
Upstream-commit: e07c392c49c44f5bc8986bad6378d9c5228669ce
Component: engine
2017-02-02 11:51:44 -08:00
b481e6b38d Merge pull request #28199 from yongtang/11062016-service-ls-format
Add `--format` to `docker service ls`
Upstream-commit: 4ca00c09b6ab7fb4fce0b909516e6b972f463c23
Component: engine
2017-02-02 10:40:04 +01:00
38bc957cc1 Merge pull request #30203 from allencloud/validate-healthcheck-params-in-daemon-side
validate healthcheck params in daemon side
Upstream-commit: bb0a532fc21cb6b9390fb7e5eb0054bdc8045bbc
Component: engine
2017-02-01 21:19:30 -05:00
98919fc990 Merge pull request #29747 from xlgao-zju/break-the-for
exit collect when we get EOF
Upstream-commit: 3c64061b6719e26a2a14d314d39f42e7df6ad9a4
Component: engine
2017-02-01 22:29:18 +01:00
256ff53fbd Add --format to docker service ls
This fix tries to improve the display of `docker service ls`
and adds `--format` flag to `docker service ls`.

In addition to `--format` flag, several other improvement:
1. Updates `docker stacks service`.
2. Adds `servicesFormat` to config file.

Related docs has been updated.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 000f0403d9084e8da427bafac3b594a822b3c386
Component: engine
2017-02-01 08:33:19 -08:00
ba31fcddc2 Merge pull request #29692 from yongtang/29492-daemon-shm-size
Add daemon option `--default-shm-size`
Upstream-commit: 354bd4aaddc3072dbe9ead45b22a1eaccda6a506
Component: engine
2017-02-01 16:56:10 +01:00
9655371ac7 Merge pull request #28627 from yongtang/28624-docker-plugin-ls
Add `--filter enabled=true` for `docker plugin ls`
Upstream-commit: 4c1b40b9d4a301edc5874e59edcec0f015490fec
Component: engine
2017-02-01 16:52:00 +01:00
313335dc3d Merge pull request #22563 from mlaventure/cgroup-devices
Allow adding rules to cgroup devices.allow on container create/run
Upstream-commit: 27f90acd61f4937f1f722082793e806261e527f7
Component: engine
2017-02-01 16:29:34 +01:00
20b0782c41 Merge pull request #30506 from vdemeester/29732-follow-up-compose-indempotent
Make docker stack deploy a little bit more indempotent
Upstream-commit: feb8b1c5818c178a9d51f539c8afca7f0c759ac4
Component: engine
2017-01-31 13:35:04 -08:00
cc26ad0039 Merge pull request #30162 from yongtang/29972-service-read-only
Add `--read-only` for `service create` and `service update`
Upstream-commit: 1d2f5de49aad9f35e3fc3160693a07a86998d3dc
Component: engine
2017-01-31 13:20:00 -08:00
46d59f3006 Merge pull request #30411 from thaJeztah/fix-build-from-local-github-directories
do not ignore local build-contexts starting with "github.com"
Upstream-commit: 048fc98c09fb85b827f3caf69c460e9ad6aa095a
Component: engine
2017-01-31 12:45:11 -08:00
2002a67479 Merge pull request #30521 from dnephin/cleanup-compose-loader
`cli/compose` cleanup - remove the old loading system
Upstream-commit: 3e6712a6ef3ac7ed0e622544f4a99dbe2c40923c
Component: engine
2017-01-30 13:55:23 -08:00
2af5a366ad Add --read-only for service create and service update
This fix tries to address the issue raised in 29972 where
it was not possible to specify `--read-only` for `docker service create`
and `docker service update`, in order to have the container's root file
system to be read only.

This fix adds `--read-only` and update the `ReadonlyRootfs` in `HostConfig`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 29972.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 499a0dd43e50c6f253f8890f5c54ae99675b1e7e
Component: engine
2017-01-30 12:47:26 -08:00
c74a5fc7cf Merge pull request #30186 from thaJeztah/add-version-annotation-to-flags
Add version annotation to various flags added in 1.13
Upstream-commit: a08da82a28848b4857e86b9a493143e9ac3fcee6
Component: engine
2017-01-30 12:33:36 -08:00
5c27e35fbb validate healthcheck params in daemon side
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: e399c558e6eeef519a84a2e0bb11dade5a345014
Component: engine
2017-01-29 13:35:32 +08:00
3526619d18 remove cli/command/secrets/utils.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 51b37a7983435edcd2331571bcb85b2686cbd006
Component: engine
2017-01-29 13:32:49 +08:00
bb6c1d5874 add endpoint mode a default value
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9eacabbfb7d70f582a8c0064c38f1b62c61a4869
Component: engine
2017-01-28 20:46:34 +08:00
4f66b8d7bd Remove the old loading system from compose config loading
The original Compose config loading used the `compose` tag, which
was replaced by mapstructure. Some fields were left on the old tag. This
commit removes the old tag and uses types and mapstructure.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: daaeeafa7ae3a4afbff530861a9ed4a97e2c431f
Component: engine
2017-01-27 17:03:41 -05:00
47697dba88 Merge pull request #29218 from yongtang/28884-secret-inspect-follow-up
Move secret name or ID prefix resolving from client to daemon
Upstream-commit: 3c32e1775a174edfc6883a7167326bc91bc2eb24
Component: engine
2017-01-27 13:31:04 -08:00
f890132120 Update opts.MemBytes to disable default, and move docker run/create/build to use opts.MemBytes
This fix made several updates:
1. Update opts.MemBytes so that default value will not show up.
   The reason is that in case a default value is decided by daemon,
   instead of client, we actually want to not show default value.
2. Move `docker run/create/build` to use opts.MemBytes for `--shm-size`
   This is to bring consistency between daemon and docker run
3. docs updates.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d1982862cacb74fb28f8103d0774960fd59a5373
Component: engine
2017-01-27 12:17:06 -08:00
b4140d991e Add daemon option --default-shm-size
This fix fixes issue raised in 29492 where it was not
possible to specify a default `--default-shm-size` in daemon
configuration for each `docker run``.

The flag `--default-shm-size` which is reloadable, has been
added to the daemon configuation.
Related docs has been updated.

This fix fixes 29492.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: db575ef626e8b2660750cbede6b19e951a3b4341
Component: engine
2017-01-27 12:17:06 -08:00
754408c859 Move secret name or ID prefix resolving from client to daemon
This fix is a follow up for comment:
https://github.com/docker/docker/pull/28896#issuecomment-265392703

Currently secret name or ID prefix resolving is done at the client
side, which means different behavior of API and CMD.

This fix moves the resolving from client to daemon, with exactly the
same rule:
- Full ID
- Full Name
- Partial ID (prefix)

All existing tests should pass.

This fix is related to #288896, #28884 and may be related to #29125.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: fa358a87571f9212f91d8fde6696926d76ecca64
Component: engine
2017-01-27 10:40:05 -08:00
7e2571b991 Add [OPTIONS] to usage of plugin disable|push
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: aad095f573e99b69366f46d6da5bc6536f4237f1
Component: engine
2017-01-27 16:17:02 +01:00
516582f2e7 Make docker stack deploy a little bit more indempotent
Sort some slice fields before sending them to the swarm api so that it
won't trigger an update.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8b1c6bfe3d779c05917b08d3c0de03b78ce68672
Component: engine
2017-01-27 16:09:02 +01:00
947241845a Add --filter enabled=true for docker plugin ls
This fix adds `--filter enabled=true` to `docker plugin ls`,
as was specified in 28624.

The related API and docs has been updated.

An integration test has been added.

This fix fixes 28624.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a66e0dc349dad2d45685846a95fe1d6da967a46d
Component: engine
2017-01-26 13:16:11 -08:00
9e237a57b2 Set default values for uid and gid to prevent errors when starting a service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 167b3f95b7f659817f8421742ca4078edd42dbaa
Component: engine
2017-01-26 12:00:46 -05:00
dd9f330ae3 Rebase Compose v3.1 schema on the latest v3 schema.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b4f23bbc69f58662f8d94b0492d693e43d523e47
Component: engine
2017-01-26 11:33:15 -05:00
9e92b82db9 Remove secrets as part of stack remove.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f0a5531c46c3fe602b372de434125a3cd046a0b6
Component: engine
2017-01-26 11:33:15 -05:00
f693277e41 Test and fix external secrets in stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b3427e43edc56824f762e964c955b906fa363a3a
Component: engine
2017-01-26 11:33:15 -05:00
5ed83fcbc5 Add integration test for stack deploy with secrets.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6ec84ef76df30663d5728f903b314f4486587135
Component: engine
2017-01-26 11:33:15 -05:00
fc26836a78 Implement secret types for compose file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9419e7df2b54b684bef6c787239a2c92fbb4acda
Component: engine
2017-01-26 11:33:15 -05:00
9fa961acee Add v3.1 schema and support validating multiple version.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 65374488f92512cf34667cb71ea6d62985310f65
Component: engine
2017-01-26 11:33:15 -05:00
b35799c15f Allow adding rules to cgroup devices.allow on container create/run
This introduce a new `--device-cgroup-rule` flag that allow a user to
add one or more entry to the container cgroup device `devices.allow`

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 1756af6fafabd9197feb56c0324e49dd7d30b11f
Component: engine
2017-01-26 07:20:45 -08:00
0dedd22a73 Merge pull request #30043 from dmcgowan/distribution-reference-update-1
Distribution reference update
Upstream-commit: e9c0de0de65182915d1cd205f06f5c903c20a29f
Component: engine
2017-01-24 20:38:20 -08:00
3a33131bc7 Merge pull request #30291 from yongtang/30279-ps-format
Fix failure in `docker ps --format` when `.Label` has args
Upstream-commit: 42d25de1b75a1f5b0d8369889b00b83e212c1d92
Component: engine
2017-01-24 17:55:52 -08:00
5ce50d238a Merge pull request #30325 from dnephin/add-internal-to-compose-network
Add network.internal to Compose schema
Upstream-commit: 4726fd120334ad5452c53a4f031893543da10e1a
Component: engine
2017-01-24 17:16:08 -08:00
20217e017d do not ignore local build-contexts starting with "github.com"
Docker special-cases build-contexts starting with `github.com`, and
treats them as remote URLs.

Because of this special treatment, local build contexts in a directory
named "github.com" are ignored by `docker build`.

This patch changes the way the build-context is detected and first
checks if a local path with the given name exists before considering
it to be a remote URL.

Before this change;

    $ mkdir -p github.com/foo/bar && echo -e "FROM scratch\nLABEL iam=local" > github.com/foo/bar/Dockerfile

    $ docker build -t dont-ignore-me github.com/foo/bar
    Username for 'https://github.com':

After this change;

    $ mkdir -p github.com/foo/bar && echo -e "FROM scratch\nLABEL iam=local" > github.com/foo/bar/Dockerfile

    $ docker build -t dont-ignore-me github.com/foo/bar
    Sending build context to Docker daemon 2.048 kB
    Step 1/2 : FROM scratch
     --->
    Step 2/2 : LABEL iam local
     ---> Using cache
     ---> ae2c603fe970
    Successfully built ae2c603fe970

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 37a1a84d913a64cec7bc05d44a7e4c5c3445a8ae
Component: engine
2017-01-24 17:44:44 +01:00
465587cda7 Merge pull request #30378 from mlaventure/fix-negative-size
Ensure proper value is used when computing reclaimable space
Upstream-commit: ee7682ebaedba6025f585c3ab6f0d61513e54e06
Component: engine
2017-01-24 09:24:53 -05:00
c6a1cf9cb8 Merge pull request #29900 from yongtang/29226-network-format-created-at
Add `.CreatedAt` placeholder for `docker network ls --format`
Upstream-commit: 8820266c17beede7d08b6b077383978f3b7b239f
Component: engine
2017-01-24 11:01:37 +01:00
1540000352 Merge pull request #30211 from thaJeztah/fix-content-trust-flags
fix flag descriptions for content-trust
Upstream-commit: 7fed0830f398e704115c7583192f01c058703277
Component: engine
2017-01-23 23:52:11 +01:00