Commit graph

7238 commits

Author SHA1 Message Date
Sebastiaan van Stijn
51c7992928
API: add "prune" events
This patch adds a new "prune" event type to indicate that pruning of a resource
type completed.

This event-type can be used on systems that want to perform actions after
resources have been cleaned up. For example, Docker Desktop performs an fstrim
after resources are deleted (https://github.com/linuxkit/linuxkit/tree/v0.7/pkg/trim-after-delete).

While the current (remove, destroy) events can provide information on _most_
resources, there is currently no event triggered after the BuildKit build-cache
is cleaned.

Prune events have a `reclaimed` attribute, indicating the amount of space that
was reclaimed (in bytes). The attribute can be used, for example, to use as a
threshold for performing fstrim actions. Reclaimed space for `network` events
will always be 0, but the field is added to be consistent with prune events for
other resources.

To test this patch:

Create some resources:

    for i in foo bar baz; do \
        docker network create network_$i \
        && docker volume create volume_$i \
        && docker run -d --name container_$i -v volume_$i:/volume busybox sh -c 'truncate -s 5M somefile; truncate -s 5M /volume/file' \
        && docker tag busybox:latest image_$i; \
    done;

    docker pull alpine
    docker pull nginx:alpine

    echo -e "FROM busybox\nRUN truncate -s 50M bigfile" | DOCKER_BUILDKIT=1 docker build -

Start listening for "prune" events in another shell:

    docker events --filter event=prune

Prune containers, networks, volumes, and build-cache:

    docker system prune -af --volumes

See the events that are returned:

    docker events --filter event=prune
    2020-07-25T12:12:09.268491000Z container prune  (reclaimed=15728640)
    2020-07-25T12:12:09.447890400Z network prune  (reclaimed=0)
    2020-07-25T12:12:09.452323000Z volume prune  (reclaimed=15728640)
    2020-07-25T12:12:09.517236200Z image prune  (reclaimed=21568540)
    2020-07-25T12:12:09.566662600Z builder prune  (reclaimed=52428841)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-28 12:41:14 +02:00
Tibor Vass
846b7e24ba
Merge pull request #41254 from AkihiroSuda/deprecate-kernel-memory
Deprecate KernelMemory
2020-07-28 10:43:29 +02:00
Sebastiaan van Stijn
4750c28eea
Merge pull request #41236 from thaJeztah/move_version_to_definitions
Swagger: move system version response to definitions
2020-07-28 09:35:20 +02:00
Sebastiaan van Stijn
b36e87af03
Merge pull request #41249 from cpuguy83/swarm_caps
Replace swarm Capabilites API with cap add/drop API
2020-07-28 01:07:49 +02:00
Sebastiaan van Stijn
f2cc755f66
docs: API v1.39: move system version response to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-27 21:07:24 +02:00
Sebastiaan van Stijn
e221931ccd
docs: API v1.40: move system version response to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-27 21:03:39 +02:00
Brian Goff
4db39ab1a0
Merge pull request #41267 from thaJeztah/swagger_fix_buildcache_types 2020-07-27 12:02:53 -07:00
Brian Goff
24f173a003 Replace service "Capabilities" w/ add/drop API
After dicussing with maintainers, it was decided putting the burden of
providing the full cap list on the client is not a good design.
Instead we decided to follow along with the container API and use cap
add/drop.

This brings in the changes already merged into swarmkit.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-07-27 10:09:42 -07:00
Sebastiaan van Stijn
9a6402d761
docs: API v1.39: fix type for BuildCache CreatedAt and LastUsedAt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-27 12:13:27 +02:00
Sebastiaan van Stijn
a305abb1d1
docs: API v1.40: fix type for BuildCache CreatedAt and LastUsedAt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-27 12:12:25 +02:00
Akihiro Suda
b8ca7de823
Deprecate KernelMemory
Kernel memory limit is not supported on cgroup v2.
Even on cgroup v1, kernel memory limit (`kmem.limit_in_bytes`) has been deprecated since kernel 5.4.
0158115f70

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-07-24 20:44:29 +09:00
Sebastiaan van Stijn
a8b2272ab3
swagger: sync updates to v1.39
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-23 13:52:51 +02:00
Sebastiaan van Stijn
1e89ca40ba
swagger: sync updates to v1.40
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-23 13:35:54 +02:00
Sebastiaan van Stijn
d4b3e786ed
docs: add mention of DefaultAddressPools to API history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-20 14:36:57 +02:00
Sebastiaan van Stijn
63382e5f3b
docs: sync API v1.39 swagger formatting with current version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-03 20:32:51 +02:00
Sebastiaan van Stijn
01244e85e7
docs: sync API v1.40 swagger formatting with current version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-03 15:42:41 +02:00
Jie Ma
3b80af727a fix typos and grammar in docs
Signed-off-by: Jie Ma <jienius@outlook.com>
2020-06-26 17:30:59 -06:00
Sebastiaan van Stijn
687bdc7c71
API: swarm: move PidsLimit to TaskTemplate.Resources
The initial implementation followed the Swarm API, where
PidsLimit is located in ContainerSpec. This is not the
desired place for this property, so moving the field to
TaskTemplate.Resources in our API.

A similar change should be made in the SwarmKit API (likely
keeping the old field for backward compatibility, because
it was merged some releases back)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-05 12:50:38 +02:00
Daniel Black
521ac858e7 doc: server API Correct ImagesCreate - platform parameter added in 1.32
closes: docker/docker.github.io#9305

Signed-off-by: Daniel Black <daniel@linux.ibm.com>
2020-06-03 11:57:31 +10:00
Akihiro Suda
f350b53241 cgroup2: implement docker info
ref: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-04-17 07:20:01 +09:00
Sebastiaan van Stijn
c8e31dc2f2
Merge pull request #39882 from thaJeztah/swarm_pids_limit
Add API support for PidsLimit on services
2020-04-16 21:02:30 +02:00
Sebastiaan van Stijn
54d88a7cd3
Merge pull request #40478 from cpuguy83/dont-prime-the-stats
Add stats options to not prime the stats
2020-04-16 20:57:06 +02:00
Sebastiaan van Stijn
157c53c8e0
Add API support for PidsLimit on services
Support for PidsLimit was added to SwarmKit in docker/swarmkit/pull/2415,
but never exposed through the Docker remove API.

This patch exposes the feature in the repote API.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-15 22:37:42 +02:00
Sebastiaan van Stijn
e9348898d3
api docs: fix broken link on GitHub
The pages that were linked to have moved, so changing the
links to point to docs.docker.com instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-09 13:44:51 +02:00
Sebastiaan van Stijn
2b8ae08571
docs: add API versions v1.30 - v1.37
Adding separate documents for older API versions, so that these don't have to
be collected from each tag/release branch. For each version of the API, I picked
the highest release that uses the API (to make sure to include possible fixes
in the swagger);

    git mv api/swagger.yaml api/swagger-current.yaml

    git checkout v18.05.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.37.yaml

    git checkout v18.02.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.36.yaml

    git checkout v18.01.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.35.yaml

    git checkout v17.11.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.34.yaml

    git checkout v17.10.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.33.yaml

    git checkout v17.09.1-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.32.yaml

    git checkout v17.07.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.31.yaml

    git checkout v17.06.2-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.30.yaml

    git mv api/swagger-current.yaml api/swagger.yaml

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-06 10:14:15 +02:00
Akihiro Suda
745fa04e52 service: support --mount type=bind,bind-nonrecursive
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-13 19:01:28 +09:00
Sebastiaan van Stijn
616e64b42f
API: deprecate /info "ClusterStore" and "ClusterAdvertise" fields
These fields will now be omitted when empty.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-03 18:10:47 +01:00
Brian Goff
ce1ceeb257 Add stats options to not prime the stats
Metrics collectors generally don't need the daemon to prime the stats
with something to compare since they already have something to compare
with.
Before this change, the API does 2 collection cycles (which takes
roughly 2s) in order to provide comparison for CPU usage over 1s. This
was primarily added so that `docker stats --no-stream` had something to
compare against.

Really the CLI should have just made a 2nd call and done the comparison
itself rather than forcing it on all API consumers.
That ship has long sailed, though.

With this change, clients can set an option to just pull a single stat,
which is *at least* a full second faster:

Old:
```
time curl --unix-socket
/go/src/github.com/docker/docker/bundles/test-integration-shell/docker.sock
http://./containers/test/stats?stream=false\&one-shot=false > /dev/null
2>&1

real0m1.864s
user0m0.005s
sys0m0.007s

time curl --unix-socket
/go/src/github.com/docker/docker/bundles/test-integration-shell/docker.sock
http://./containers/test/stats?stream=false\&one-shot=false > /dev/null
2>&1

real0m1.173s
user0m0.010s
sys0m0.006s
```

New:
```
time curl --unix-socket
/go/src/github.com/docker/docker/bundles/test-integration-shell/docker.sock
http://./containers/test/stats?stream=false\&one-shot=true > /dev/null
2>&1
real0m0.680s
user0m0.008s
sys0m0.004s

time curl --unix-socket
/go/src/github.com/docker/docker/bundles/test-integration-shell/docker.sock
http://./containers/test/stats?stream=false\&one-shot=true > /dev/null
2>&1

real0m0.156s
user0m0.007s
sys0m0.007s
```

This fixes issues with downstreams ability to use the stats API to
collect metrics.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-02-28 09:54:37 -08:00
Sebastiaan van Stijn
6fdbc50084
docs: add API versions v1.25 - v1.29, v1.38 - v1.40
Adding separate documents for older API versions, so that these don't have to
be collected from each tag/release branch:

- v1.40 - docker v19.03
- v1.39 - docker v18.09
- v1.38 - docker v18.06
- v1.29 - docker v17.05
- v1.28 - docker v17.04
- v1.27 - docker v17.03
- v1.26 - docker v1.13.1
- v1.25 - docker v1.13.0

Note that:

- API versions v1.30 - v1.37 are yet to be added after the tags and release-
  branches from the docker/docker-ce mono-repo have been extracted.
- docker v1.13.0 made the switch from using a markdown file to using swagger
  to document the API.

Approach taken:

    git mv api/swagger.yaml api/swagger-current.yaml

    git checkout upstream/19.03 -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.40.yaml

    git checkout v18.09.9 -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.39.yaml

    git checkout v18.06.3-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.38.yaml

    git checkout v17.05.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.29.yaml

    git checkout v17.04.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.28.yaml

    git checkout v17.03.2-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.27.yaml

    git checkout v1.13.1 -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.26.yaml

    git checkout v1.13.0 -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.25.yaml

    git mv api/swagger-current.yaml api/swagger.yaml

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-24 11:00:35 +01:00
Sebastiaan van Stijn
cb3ec99b16
Merge pull request #40491 from thaJeztah/remove_deprecated_filters_opt
API: remove deprecated "filter" parameter for API v1.41 and up
2020-02-11 11:22:44 +01:00
Sebastiaan van Stijn
008fc67974
Fluentd: add fluentd-request-ack option
This adds a new `fluentd-request-ack` logging option for the Fluentd
logging driver. If enabled, the server will respond with an acknowledgement.
This option improves the reliability of the message transmission. This
change is not versioned, and affects all API versions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-11 02:13:24 +01:00
Sebastiaan van Stijn
cc1f3c750e
Fluentd: add fluentd-async option, deprecate fluentd-async-connect
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-11 02:13:22 +01:00
Sebastiaan van Stijn
4a1900915a
API: remove deprecated "filter" parameter for API v1.41 and up
This query-parameter was deprecated in docker 1.13 in commit
820b809e70, and scheduled for
removal in docker 17.12, so we should remove it for the next
API version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-10 17:21:01 +01:00
Sebastiaan van Stijn
ed439e4a31
swagger: document "node.platform.(arch|os)" constraints
Support for these constraints was added in docker 1.13.0
(API v1.25), but never documented.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-10 15:32:32 +01:00
Sebastiaan van Stijn
ac058c1629
Merge pull request #40340 from thaJeztah/swagger_remove_classic_swarm_node
Swagger/API update "standalone" API fields
2020-01-23 20:45:46 +01:00
Drew Erny
30d9fe30b1 Add swarm jobs
Adds support for ReplicatedJob and GlobalJob service modes. These modes
allow running service which execute tasks that exit upon success,
instead of daemon-type tasks.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2020-01-13 13:21:12 -06:00
Sebastiaan van Stijn
8311d6ba9f
API: omit classic swarm "SystemStatus" field if empty
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-01-06 12:25:05 +01:00
Akihiro Suda
b682cda946 docs/rootless.md: move to https://docs.docker.com/engine/security/rootless/
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-12-03 23:56:26 +09:00
Sebastiaan van Stijn
a8b04b17fd
Merge pull request #40028 from thaJeztah/session_endpoint_docs_updates
API: update docs that /session left experimental in V1.39
2019-10-19 01:18:21 +02:00
Justin Cormack
19a4fa7bf1
Merge pull request #40076 from AkihiroSuda/update-rootless-docs
docs/rootless.md: update
2019-10-17 11:39:33 -07:00
Drew Erny
f36042d259 Add support for sending down service Running and Desired task counts
Adds a new ServiceStatus field to the Service object, which includes the
running and desired task counts. This new field is gated behind a
"status" query parameter.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2019-10-14 10:43:00 -05:00
Akihiro Suda
e76dea157e docs/rootless.md: update
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-10-13 20:19:00 +09:00
Sebastiaan van Stijn
6756f5f378
API: update docs that /session left experimental in V1.39
The `/session` endpoint left experimental in API V1.39 through
239047c2d3 and
01c9e7082e, but the API reference
was not updated accordingly.

This updates the API documentation to match the change.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-02 12:30:38 +02:00
Brian Goff
40b9333523
Merge pull request #39993 from feliperuhland/fix-doc-inline-code
Fix Engine API version history typo
2019-09-26 17:19:35 -07:00
Felipe Ruhland
8107d44852 Fix Engine API version history typo
Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
2019-09-26 14:30:41 -03:00
Sebastiaan van Stijn
5175ed54e5
hack/ci/windows.ps1 update references to repositories that were moved
Also updated the related docs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 12:14:38 +02:00
Tibor Vass
f1c1cd436a integration-cli: move each test suite to its own TestX testing function
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-18 18:26:36 +00:00
Tibor Vass
6754976015
Merge pull request #39888 from vikramhh/move_windows_gopath_out_of_goroot
Move GOPATH out from under the GO source tree
2019-09-10 14:33:12 -07:00
Vikram bir Singh
ecf91f0d7f Move GOPATH out from under the GO source tree
Unlike Linux which uses a temp dir as GOPATH, Windows
uses c:\go. Among other things, this blocks go get.

Moving GOPATH to c:\gopath and updating references in
comments and documentation.

Currently the change is being scoped narrowly. In the
future GOPATH value could be passed as a parameter to
the ps1 scripts.

Signed-off-by: Vikram bir Singh <vikrambir.singh@docker.com>
2019-09-10 16:57:33 +00:00
Tibor Vass
7cd028f2d0 hack: update scripts
- remove -check.* flags
- use (per-test) -timeout flag
- allow user to override TEST_SKIP_* regardless of TESTFLAGS
- remove test-imports validation

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-09 21:09:57 +00:00
Zuhayr Elahi
438c7eb606
Added information regarding our new Jenkins ci on moby/moby
Added link to header

Signed-off-by: Zuhayr Elahi <elahi.zuhayr@gmail.com>
2019-07-30 13:48:00 -07:00
Akihiro Suda
34f4729bc0 rootless: allow exposing dockerd TCP socket easily
eg.

  $ DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="-p 0.0.0.0:2376:2376/tcp" \
   dockerd-rootless.sh --experimental \
   -H tcp://0.0.0.0:2376 \
   --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem

This commit bumps up RootlessKit from v0.4.1 to v0.6.0:
27a0c7a248...2fcff6ceae

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-07-11 11:09:29 +09:00
Sebastiaan van Stijn
53430f5fc1
Add info OSVersion to API changelog.
This was added in d363a1881e (moby/moby#38349),
but not yet added to the API history.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-21 15:39:49 +02:00
Kirill Kolyshkin
1d5748d975
Merge pull request #39173 from olljanat/25885-capabilities-swarm
Add support for capabilities options in services
2019-06-06 15:03:46 -07:00
Akihiro Suda
e0fefb9a7f
Merge pull request #39309 from thaJeztah/fix_api_history2
Move cgroup info changes to API v1.40
2019-06-06 13:39:35 +09:00
Sebastiaan van Stijn
71e00574c7
Merge pull request #39279 from ZYecho/fix-swagger-copy
fix: fix lack of copyUIDGID in swagger.yaml
2019-06-05 13:13:59 +02:00
zhangyue
a4f828cb89 fix: fix lack of copyUIDGID in swagger.yaml
Signed-off-by: Zhang Yue <zy675793960@yeah.net>
Signed-off-by: zhangyue <zy675793960@yeah.net>
2019-06-05 09:58:04 +08:00
Sebastiaan van Stijn
16e04da4cb
Move cgroup info changes to API v1.40
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-03 22:50:47 +02:00
Akihiro Suda
ca5aab19b4 rootless: update docker info docs
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-06-03 19:41:50 +09:00
Olli Janatuinen
f787b235de Add support capabilities list on services
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-05-28 19:52:36 +03:00
Sebastiaan van Stijn
7bacd1d6dc
Move CgroupnsMode feature to API v1.41
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-13 15:04:28 -07:00
Sebastiaan van Stijn
771fc7e7f8
Bump API version to v1.41
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-13 14:55:20 -07:00
Rob Gulewich
072400fc4b Make cgroup namespaces configurable
This adds both a daemon-wide flag and a container creation property:
- Set the `CgroupnsMode: "host|private"` HostConfig property at
  container creation time to control what cgroup namespace the container
  is created in
- Set the `--default-cgroupns-mode=host|private` daemon flag to control
  what cgroup namespace containers are created in by default
- Set the default if the daemon flag is unset to "host", for backward
  compatibility
- Default to CgroupnsMode: "host" for client versions < 1.40

Signed-off-by: Rob Gulewich <rgulewich@netflix.com>
2019-05-07 10:22:16 -07:00
Brian Goff
51f27b1def
Merge pull request #39138 from AkihiroSuda/fix-rootless-issues-alternative-to-39024
dockerd: fix rootless detection (alternative to #39024)
2019-04-26 09:15:30 -07:00
Akihiro Suda
63a66b0eb0 rootless: optional support for lxc-user-nic SUID binary
lxc-user-nic can eliminate slirp overhead but needs /etc/lxc/lxc-usernet to be configured for the current user.

To use lxc-user-nic, $DOCKERD_ROOTLESS_ROOTLESSKIT_NET=lxc-user-nic also needs to be set.

This commit also bumps up RootlessKit from v0.3.0 to v0.4.0:
70e0502f32...e92d5e772e

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-04-25 23:54:30 +09:00
Akihiro Suda
3518383ed9 dockerd: fix rootless detection (alternative to #39024)
The `--rootless` flag had a couple of issues:
* #38702: euid=0, $USER="root" but no access to cgroup ("rootful" Docker in rootless Docker)
* #39009: euid=0 but $USER="docker" (rootful boot2docker)

To fix #38702, XDG dirs are ignored as in rootful Docker, unless the
dockerd is directly running under RootlessKit namespaces.

RootlessKit detection is implemented by checking whether `$ROOTLESSKIT_STATE_DIR` is set.

To fix #39009, the non-robust `$USER` check is now completely removed.

The entire logic can be illustrated as follows:

```
withRootlessKit := getenv("ROOTLESSKIT_STATE_DIR")
rootlessMode := withRootlessKit || cliFlag("--rootless")
honorXDG := withRootlessKit
useRootlessKitDockerProxy := withRootlessKit
removeCgroupSpec := rootlessMode
adjustOOMScoreAdj := rootlessMode
```

Close #39024
Fix #38702 #39009

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-04-25 16:47:01 +09:00
WithLin
213e49b8f1 change WindowsContainers.md to README.md
Signed-off-by: Fu JinLin <withlin@yeah.net>
2019-04-09 16:11:54 +08:00
WithLin
806db1c663 fix link error.
Signed-off-by: Fu JinLin <withlin@yeah.net>
2019-04-09 15:31:56 +08:00
Akihiro Suda
f0b405fbda rootless: expose ports automatically
Now `docker run -p` ports can be exposed to the host namespace automatically when `dockerd-rootless.sh` is launched with
`--userland-proxy --userland-proxy-path $(which rootlesskit-docker-proxy)`.
This is akin to how Docker for Mac/Win works with `--userland-proxy-path=/path/to/vpnkit-expose-port`.

The port number on the host namespace needs to be set to >= 1024.
SCTP ports are currently unsupported.

RootlessKit changes: 7bbbc48a6f...ed26714429

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-03-21 02:44:08 +09:00
Tibor Vass
827cb09f87
Merge pull request #38898 from tonistiigi/build-outputs
builder-next: allow outputs configuration
2019-03-19 14:00:16 -07:00
Tonis Tiigi
768c6d7b29 builder-next: allow outputs configuration
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-19 10:28:30 -07:00
Tibor Vass
8f936ae8cf Add DeviceRequests to HostConfig to support NVIDIA GPUs
This patch hard-codes support for NVIDIA GPUs.
In a future patch it should move out into its own Device Plugin.

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-03-18 17:19:45 +00:00
Sebastiaan van Stijn
9d9d3fe4b4
minor touch-up in api/version-history.md
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-16 17:49:53 +01:00
Kir Kolyshkin
596ca142e0 daemon: use 'private' ipc mode by default
This changes the default ipc mode of daemon/engine to be private,
meaning the containers will not have their /dev/shm bind-mounted
from the host by default. The benefits of doing this are:

 1. No leaked mounts. Eliminate a possibility to leak mounts into
    other namespaces (and therefore unfortunate errors like "Unable to
    remove filesystem for <ID>: remove /var/lib/docker/containers/<ID>/shm:
    device or resource busy").

 2. Working checkpoint/restore. Make `docker checkpoint`
    not lose the contents of `/dev/shm`, but save it to
    the dump, and be restored back upon `docker start --checkpoint`
    (currently it is lost -- while CRIU handles tmpfs mounts,
    the "shareable" mount is seen as external to container,
    and thus rightfully ignored).

3. Better security. Currently any container is opened to share
   its /dev/shm with any other container.

Obviously, this change will break the following usage scenario:

 $ docker run -d --name donor busybox top
 $ docker run --rm -it --ipc container:donor busybox sh
 Error response from daemon: linux spec namespaces: can't join IPC
 of container <ID>: non-shareable IPC (hint: use IpcMode:shareable
 for the donor container)

The soution, as hinted by the (amended) error message, is to
explicitly enable donor sharing by using --ipc shareable:

 $ docker run -d --name donor --ipc shareable busybox top

Compatibility notes:

1. This only applies to containers created _after_ this change.
   Existing containers are not affected and will work fine
   as their ipc mode is stored in HostConfig.

2. Old backward compatible behavior ("shareable" containers
   by default) can be enabled by either using
   `--default-ipc-mode shareable` daemon command line option,
   or by adding a `"default-ipc-mode": "shareable"`
   line in `/etc/docker/daemon.json` configuration file.

3. If an older client (API < 1.40) is used, a "shareable" container
   is created. A test to check that is added.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-03-09 18:57:42 -08:00
Sebastiaan van Stijn
ca91918dd4
docs follow-ups for networks "dangling" filter
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-28 17:54:31 +01:00
Sebastiaan van Stijn
fc77445147
Add new PidsLimit options to API version history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-24 14:27:30 +01:00
Drew Erny
6f1d7ddfa4 Use Runtime target
The Swarmkit api specifies a target for configs called called "Runtime"
which indicates that the config is not mounted into the container but
has some other use. This commit updates the Docker api to reflect this.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2019-02-19 13:14:17 -06:00
Sebastiaan van Stijn
20383d504b Add support for using Configs as CredentialSpecs in services
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-04 15:29:33 -06:00
Akihiro Suda
ec87479b7e allow running dockerd in an unprivileged user namespace (rootless mode)
Please refer to `docs/rootless.md`.

TLDR:
 * Make sure `/etc/subuid` and `/etc/subgid` contain the entry for you
 * `dockerd-rootless.sh --experimental`
 * `docker -H unix://$XDG_RUNTIME_DIR/docker.sock run ...`

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-02-04 00:24:27 +09:00
Sebastiaan van Stijn
7e7e100be0
Add HEAD support for /_ping endpoint
Monitoring systems and load balancers are usually configured to use HEAD
requests for health monitoring. The /_ping endpoint currently does not
support this type of request, which means that those systems have fallback
to GET requests.

This patch adds support for HEAD requests on the /_ping endpoint.

Although optional, this patch also returns `Content-Type` and `Content-Length`
headers in case of a HEAD request; Refering to RFC 7231, section 4.3.2:

    The HEAD method is identical to GET except that the server MUST NOT
    send a message body in the response (i.e., the response terminates at
    the end of the header section).  The server SHOULD send the same
    header fields in response to a HEAD request as it would have sent if
    the request had been a GET, except that the payload header fields
    (Section 3.3) MAY be omitted.  This method can be used for obtaining
    metadata about the selected representation without transferring the
    representation data and is often used for testing hypertext links for
    validity, accessibility, and recent modification.

    A payload within a HEAD request message has no defined semantics;
    sending a payload body on a HEAD request might cause some existing
    implementations to reject the request.

    The response to a HEAD request is cacheable; a cache MAY use it to
    satisfy subsequent HEAD requests unless otherwise indicated by the
    Cache-Control header field (Section 5.2 of [RFC7234]).  A HEAD
    response might also have an effect on previously cached responses to
    GET; see Section 4.3.5 of [RFC7234].

With this patch applied, either `GET` or `HEAD` requests work; the only
difference is that the body is empty in case of a `HEAD` request;

    curl -i --unix-socket /var/run/docker.sock http://localhost/_ping
    HTTP/1.1 200 OK
    Api-Version: 1.40
    Cache-Control: no-cache, no-store, must-revalidate
    Docker-Experimental: false
    Ostype: linux
    Pragma: no-cache
    Server: Docker/dev (linux)
    Date: Mon, 14 Jan 2019 12:35:16 GMT
    Content-Length: 2
    Content-Type: text/plain; charset=utf-8

    OK

    curl --head -i --unix-socket /var/run/docker.sock http://localhost/_ping
    HTTP/1.1 200 OK
    Api-Version: 1.40
    Cache-Control: no-cache, no-store, must-revalidate
    Content-Length: 0
    Content-Type: text/plain; charset=utf-8
    Docker-Experimental: false
    Ostype: linux
    Pragma: no-cache
    Server: Docker/dev (linux)
    Date: Mon, 14 Jan 2019 12:34:15 GMT

The client is also updated to use `HEAD` by default, but fallback to `GET`
if the daemon does not support this method.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-31 18:18:24 +01:00
Yong Tang
393838ca5e
Merge pull request #38569 from thaJeztah/forget_about_it
Add Cache-Control headers to disable caching /_ping endpoint
2019-01-31 23:59:11 +08:00
Olli Janatuinen
80d7bfd54d Capabilities refactor
- Add support for exact list of capabilities, support only OCI model
- Support OCI model on CapAdd and CapDrop but remain backward compatibility
- Create variable locally instead of declaring it at the top
- Use const for magic "ALL" value
- Rename `cap` variable as it overlaps with `cap()` built-in
- Normalize and validate capabilities before use
- Move validation for conflicting options to validateHostConfig()
- TweakCapabilities: simplify logic to calculate capabilities

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-22 21:50:41 +02:00
Sebastiaan van Stijn
5f788fbf56
Add Cache-Control headers to disable caching /_ping endpoint
The result of this endpoint should not be cached, so it's better to
explicitly disable caching.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-14 22:03:23 +01:00
Olli Janatuinen
153171e9dd Added support for maximum replicas per node to services
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2018-12-24 02:04:15 +02:00
Mohammad Nasirifar
c46c3c1689 Update test.md doc to fix sample test regex
Remove the extra dollar sign from the test regex so the command
would find the desired test.

Signed-off-by: Mohammad Nasirifar <farnasirim@gmail.com>
2018-12-13 20:35:49 -05:00
Jonathan A. Schweder
126f371e47 Fix mistake in docs/contributing/test.md running specific unit test (#38096)
Signed-off-by: Jonathan A. Schweder <jonathanschweder@gmail.com>
2018-12-10 11:01:46 -02:00
Yong Tang
f023816608 Add memory.kernelTCP support for linux
This fix tries to address the issue raised in 37038 where
there were no memory.kernelTCP support for linux.

This fix add MemoryKernelTCP to HostConfig, and pass
the config to runtime-spec.

Additional test case has been added.

This fix fixes 37038.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-11-26 21:03:08 +00:00
selansen
32180ac0c7 VXLAN UDP Port configuration support
This commit contains changes to configure DataPathPort
option. By default we use 4789 port number. But this commit
will allow user to configure port number during swarm init.
DataPathPort can't be modified after swarm init.
Signed-off-by: selansen <elango.siva@docker.com>
2018-11-22 17:35:02 -05:00
Akihiro Suda
596cdffb9f mount: add BindOptions.NonRecursive (API v1.40)
This allows non-recursive bind-mount, i.e. mount(2) with "bind" rather than "rbind".

Swarm-mode will be supported in a separate PR because of mutual vendoring.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-11-06 17:51:58 +09:00
Sebastiaan van Stijn
c20aa781e6
Move support for filtering on node labels to API v1.40
This feature was added in 514ce73391,
and was merged after API v1.39 shipped as part of the Docker 18.09

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-10-26 15:51:23 +02:00
Sebastiaan van Stijn
cb9d2cb71b
Move support for sysctl options in services to API v1.40
This feature was added in 14da20f5e7,
and was merged after API v1.39 shipped as part of the Docker 18.09
release candidates.

This commit moves the feature to the correct API version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-10-26 15:39:36 +02:00
Sebastiaan van Stijn
e238713cc9
Update API version to v1.40
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-10-26 15:34:27 +02:00
Yong Tang
87e7930892
Merge pull request #37879 from kolyshkin/no-i
go {build,test}: rm -i option, add go cache volume
2018-09-26 12:52:22 -07:00
Kir Kolyshkin
bdcd81d330 go {build,test}: rm -i option, add go cache volume
Looks like -i (together with DOCKER_INCREMENTAL_BINARY etc)
were used to get faster incremental builds.

Nowdays (since Go 1.10) this is no longer the case, as
go build cache is used [1]. Here's a quote:

> You do not have to use "go test -i" or "go build -i" or
> "go install" just to get fast incremental builds. We will
> not have to teach new users those workarounds anymore.
> Everything will just be fast.

To enable go cache between builds, add a volume for /root/.cache.

[1] https://groups.google.com/forum/#!msg/golang-dev/qfa3mHN4ZPA/X2UzjNV1BAAJ

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-26 10:10:42 -07:00
Drew Erny
14da20f5e7 Add support for sysctl options in services
Adds support for sysctl options in docker services.

* Adds API plumbing for creating services with sysctl options set.
* Adds swagger.yaml documentation for new API field.
* Updates the API version history document.
* Changes executor package to make use of the Sysctls field on objects
* Includes integration test to verify that new behavior works.

Essentially, everything needed to support the equivalent of docker run's
`--sysctl` option except the CLI.

Includes a vendoring of swarmkit for proto changes to support the new
behavior.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2018-09-20 10:51:56 -05:00
Anshul Pundir
514ce73391
Changes to cluster/filter, swagger.yaml, version-history.md for filtering on node labels.
Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-21 22:17:23 +02:00
Sebastiaan van Stijn
a3d4238b9c
Add "Warnings" to /info endpoint, and move detection to the daemon
When requesting information about the daemon's configuration through the `/info`
endpoint, missing features (or non-recommended settings) may have to be presented
to the user.

Detecting these situations, and printing warnings currently is handled by the
cli, which results in some complications:

- duplicated effort: each client has to re-implement detection and warnings.
- it's not possible to generate warnings for reasons outside of the information
  returned in the `/info` response.
- cli-side detection has to be updated for new conditions. This means that an
  older cli connecting to a new daemon may not print all warnings (due to
  it not detecting the new conditions)
- some warnings (in particular, warnings about storage-drivers) depend on
  driver-status (`DriverStatus`) information. The format of the information
  returned in this field is not part of the API specification and can change
  over time, resulting in cli-side detection no longer being functional.

This patch adds a new `Warnings` field to the `/info` response. This field is
to return warnings to be presented by the user.

Existing warnings that are currently handled by the CLI are copied to the daemon
as part of this patch; This change is backward-compatible with existing
clients; old client can continue to use the client-side warnings, whereas new
clients can skip client-side detection, and print warnings that are returned by
the daemon.

Example response with this patch applied;

```bash
curl --unix-socket /var/run/docker.sock http://localhost/info | jq .Warnings
```

```json
[
  "WARNING: bridge-nf-call-iptables is disabled",
  "WARNING: bridge-nf-call-ip6tables is disabled"
]
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-21 11:36:15 +02:00
selansen
f7ad95cab9 Global Default Address Pool feature support
This feature allows user to specify list of subnets for global
default address pool. User can configure subnet list using
'swarm init' command. Daemon passes the information to swarmkit.
We validate the information in swarmkit, then store it in cluster
object. when IPAM init is called, we pass subnet list to IPAM driver.

Signed-off-by: selansen <elango.siva@docker.com>
2018-08-20 15:07:08 -04:00
Daniel Hiltgen
896d1b1c61 Expose license status in Info (#37612)
* Expose license status in Info

This wires up a new field in the Info payload that exposes the license.
For moby this is hardcoded to always report a community edition.
Downstream enterprise dockerd will have additional licensing logic wired
into this function to report details about the current license status.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>

* Code review comments

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>

* Add windows autogen support

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-08-17 17:05:21 -07:00
Sebastiaan van Stijn
e6e8ab50fa
Do not return "<unknown>" in /info response
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-16 16:09:58 +02:00
Donghwa Kim
3048c3a768 Fix typo on test.md
It said `TESTFLAGS='-test.run ^TestValidateIPAddress$' make test-unit`
runs `TestBuild` test, but actually runs `TestValidateIPAddress` test.

Signed-off-by: Donghwa Kim <shanytt@gmail.com>
2018-07-08 18:22:21 +09:00
Benjamin Baker
5122aaf26f Updated path to be consistent w/ current Windows build process
Signed-off-by: Benjamin Baker <Benjamin.baker@utexas.edu>
2018-06-15 19:02:53 -04:00
Francesco Mari
a045b027bf Fix link to Docker Toolbox
Signed-off-by: Francesco Mari <mari.francesco@gmail.com>
2018-06-08 16:12:00 +02:00
Sebastiaan van Stijn
df5175e1ee
Bump API version to v1.38
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-24 02:39:28 +02:00
Sebastiaan van Stijn
3682703ad4
Update swagger and API history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-22 23:37:33 +02:00
AJ Bowen
b7fe0b6359
Highlight meaning of 'precpu' (i.e. 'previous').
Signed-off-by: AJ Bowen <aj@soulshake.net>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-17 14:57:44 +02:00
Yong Tang
6d66743ae3 Fix incorrect link in version-history.md
In version-history.md, the link for `Docker Engine API v1.37`
was pointed to `v1.36`.

This fix fixes the incorrect link.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-05-13 13:22:39 +00:00
Sebastiaan van Stijn
a3efeaad52
Adjust minimum API version for templated configs/secrets
Also adds a note to the API version history

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-21 15:23:00 +01:00
Sebastiaan van Stijn
9f68f20fae
Merge pull request #35898 from javabrett/docs-contributing-test
test.md improvements and corrections
2018-02-21 09:32:15 +01:00
Akihiro Suda
8e435b8279 Support SCTP port mapping (bump up API to v1.37)
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-20 11:15:36 +09:00
Brett Randall
bef0cd70a6 Removed root@... PS1 from in-container root prompts, retaining #.
Signed-off-by: Brett Randall <javabrett@gmail.com>
2018-02-20 11:29:02 +11:00
Brett Randall
acaa53bc35 test.md improvements and corrections:
- Mentioned integration-cli test-suite deprecation.
- Removed mentions of removed in-container hack/make.sh
  target test-unit, replaced with hack/test/unit.

Signed-off-by: Brett Randall <javabrett@gmail.com>
2018-02-20 11:21:03 +11:00
Yong Tang
376658e414 Update API version history for Init with POST /containers/create
This is a follow up to
https://github.com/moby/moby/pull/34655#pullrequestreview-91096779

to update API version history for `Init` field.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-25 19:05:22 +00:00
Nicolas De Loof
aa6bb5cb69
introduce « exec_die » event
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2018-01-08 11:42:25 +01:00
Brett Randall
e96b33665e Fixed in-container paths in dev doc: moby/moby -> docker/docker.
Further to 355cf9483c which caught some
of these.  This should fix the remainder in the contributing docs.

Signed-off-by: Brett Randall <javabrett@gmail.com>
2017-12-28 20:22:02 -05:00
Brett Randall
b7109162ea Updated developer doc to explain included static cli and move of cli moby->docker-ce.
Signed-off-by: Brett Randall <javabrett@gmail.com>
2017-12-13 14:31:34 +11:00
Sebastiaan van Stijn
3b14e5980e
Merge pull request #35738 from thaJeztah/bump-api-version
Bump API version to 1.36
2017-12-08 22:18:24 -08:00
Sebastiaan van Stijn
8fe0a759f7
Merge pull request #35680 from javabrett/docs-contributing
Changed go vendor from moby/moby to docker/docker in dev docs.
2017-12-07 15:04:28 -08:00
Sebastiaan van Stijn
c1e982f2ee
Bump API version to 1.36
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-07 13:52:49 -08:00
Brett Randall
355cf9483c Changed go vendor from moby/moby to docker/docker in dev docs.
If there is a package-rename forthcoming, it isn't currently evident on master, but seems to show in doc.
Changed doc to show actual docker/docker paths as they occur now instead of moby/moby.

Signed-off-by: Brett Randall <javabrett@gmail.com>
2017-12-07 14:06:24 +11:00
Sebastiaan van Stijn
8a9d926b55
Update API version-history for 1.35
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-06 15:02:10 -08:00
Sebastiaan van Stijn
d9dbca2e19
Merge pull request #35708 from schomatis/fix-set-up-dev-env-link
Fix link in Contributing doc
2017-12-06 10:04:01 -08:00
Akihiro Suda
a235469f45
Merge pull request #35603 from ericsoderstrom/master
Update docs to reflect working directory name change.
2017-12-06 10:15:16 +09:00
Lucas Molas
1f0572fd1a
Fix link in Contributing doc
Signed-off-by: Lucas Molas <lmolas@fundacionsadosky.org.ar>
2017-12-05 12:31:02 -03:00
Anthony Sottile
b6eed3dca2 Change references from test-integration-cli to test-integration
Signed-off-by: Anthony Sottile <asottile@umich.edu>
2017-11-27 19:01:14 -08:00
Eric Soderstrom
f72ece0186 Update docs to reflect working directory name change.
Signed-off-by: Eric Soderstrom <ericsoderstrom@gmail.com>
2017-11-26 13:12:16 -08:00
Sebastiaan van Stijn
6f34bd6f96
Move "until" option to correct API version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-11-03 16:11:07 +01:00
Sebastiaan van Stijn
68a4552529
Merge pull request #32914 from jamiehannaford/until-logging
Add --until flag for docker logs; closes #32807
2017-11-03 16:08:30 +01:00
Sebastiaan van Stijn
dfbf0f2e91
Merge pull request #35168 from justincormack/update-contributing
First pass updating CONTRIBUTING
2017-11-03 12:57:21 +01:00
Justin Cormack
cecd0de3a9 First pass updating CONTRIBUTING
This largely removes references to Docker where possible.

The HOWTO guides are still Docker docs and refer to Docker not
moby, so the next step is to rework these as Moby docs and put
them in `docs/` in this repo.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-03 11:54:55 +00:00
Sebastiaan van Stijn
4533a16fa9
Move Isolation API changes to the correct version
Commit d91c5f42eb added
support for "Isolation" mode for services, but didn't
get merged before API 1.34.

This patch moves the description in the API version
history to the correct API version (1.35), and does
a slight rewording of the functionality.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-11-01 22:13:10 +01:00
Brian Goff
d91c5f42eb
Merge pull request #34424 from simonferquel/swarm-service-isolation
Added support for swarm service isolation mode
2017-11-01 16:41:10 -04:00
Jamie Hannaford
e8d9a61f4c Add --until flag for docker logs; closes #32807
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
2017-11-01 10:08:49 +01:00
Yong Tang
3ba1dda191
Merge pull request #35343 from thaJeztah/bump-api-version-1.35
Bump API version to 1.35
2017-10-31 12:37:12 -07:00
Sebastiaan van Stijn
ba6b5aa7f2
Bump API version to 1.35
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-31 12:57:14 +01:00
Sebastiaan van Stijn
a6f09a7509
Merge pull request #35102 from ripcurld0/doc_31926
Elaborate more about port allocation in docs
2017-10-30 20:28:36 +01:00
Simon Ferquel
f28cb422e6 Added support for swarm service isolation mode
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2017-10-30 16:16:18 +01:00
Kir Kolyshkin
f963500c54 ContainerWait on remove: don't stuck on rm fail
Currently, if a container removal has failed for some reason,
any client waiting for removal (e.g. `docker run --rm`) is
stuck, waiting for removal to succeed while it has failed already.
For more details and the reproducer, please check
https://github.com/moby/moby/issues/34945

This commit addresses that by allowing `ContainerWait()` with
`container.WaitCondition == "removed"` argument to return an
error in case of removal failure. The `ContainerWaitOKBody`
stucture returned to a client is amended with a pointer to `struct Error`,
containing an error message string, and the `Client.ContainerWait()`
is modified to return the error, if any, to the client.

Note that this feature is only available for API version >= 1.34.
In order for the old clients to be unstuck, we just close the connection
without writing anything -- this causes client's error.

Now, docker-cli would need a separate commit to bump the API to 1.34
and to show an error returned, if any.

[v2: recreate the waitRemove channel after closing]
[v3: document; keep legacy behavior for older clients]
[v4: convert Error from string to pointer to a struct]
[v5: don't emulate old behavior, send empty response in error case]
[v6: rename legacy* vars to include version suffix]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-10-25 13:11:56 -07:00
Boaz Shuster
dfd706e1a5 Elaborate more about port allocation in docs
Describe more how host port allocation is done when
container is stopped/started in "PublishAllPorts".

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-10-17 15:19:54 +03:00
Sebastiaan van Stijn
e52001c56e
Fix network name masking network ID on delete
If a network is created with a name that matches another
network's ID, the network with that name was masking the
other network's ID.

As a result, it was not possible to remove the network
with a given ID.

This patch changes the order in which networks are
matched to be what we use for other cases;

1. Match on full ID
2. Match on full Name
3. Match on Partial ID

Before this patch:

    $ docker network create foo
    336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b

    $ docker network create 336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b
    4a698333f1197f20224583abce14876d7f25fdfe416a8545927006c315915a2a

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    4a698333f119        336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b   bridge              local
    d1e40d43a2c0        bridge                                                             bridge              local
    336717eac9ea        foo                                                                bridge              local
    13cf280a1bbf        host                                                               host                local
    d9e4c03728a0        none                                                               null                local

    $ docker network rm 336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b
    4a698333f1197f20224583abce14876d7f25fdfe416a8545927006c315915a2a

    $ docker network ls
    NETWORK ID          NAME                DRIVER              SCOPE
    d1e40d43a2c0        bridge              bridge              local
    336717eac9ea        foo                 bridge              local
    13cf280a1bbf        host                host                local
    d9e4c03728a0        none                null                local

After this patch:

    $ docker network create foo
    2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835

    $ docker network create 2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835
    6cbc749a529cd2d9d3b10566c84e56c4203dd88b67417437b5fc7a6e955dd48f

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    6cbc749a529c        2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835   bridge              local
    166c943dbeb5        bridge                                                             bridge              local
    2d1791a7def4        foo                                                                bridge              local
    6c45b8aa6d8e        host                                                               host                local
    b11c96b51ea7        none                                                               null                local

    $ docker network rm 2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835
    2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    6cbc749a529c        2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835   bridge              local
    166c943dbeb5        bridge                                                             bridge              local
    6c45b8aa6d8e        host                                                               host                local
    b11c96b51ea7        none                                                               null                local

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-11 21:57:05 +02:00
Victor Vieux
6f117e266f Merge pull request #35150 from thaJeztah/fix-api-version-check
Return 400 error if API client is too new
2017-10-11 11:26:12 -07:00
Justin Cormack
9b87491729 Remove Docker logo
No longer used as we are using the Moby logo.

Refer to #35115 for more details.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-10-11 13:17:59 +01:00
Sebastiaan van Stijn
01f9227ec9
Return 400 error if API client is too new
Commit e98e4a7111 implemented API version
negotiation using the `/_ping` endpoint. In that change, URL validation for the
maximum supported API version was removed from the API server (validation for
the _minimum_ version was kept in place).

With this feature, clients that support version negotiation would negotiate the
maximum version supported by the daemon, and downgrade to an older API version
if the client's default API version is not supported.

However, clients that do _not_ support version negotiation can call API versions
that are higher than the maximum supported version. Due to the missing version
check, this is silently ignored, and the daemon's default API version is used.

This is a problem, because the actual API version in use is non-deterministic;
for example, calling `/v9999.9999/version` on a daemon that runs API v1.34 will
use API v1.34, but calling the same URL on an older daemon may use API version
v1.24.

This patch reverts the removal of the API check for maximum supported versions.
The documentation has been updated accordingly

Before this patch is applied, the daemon returns a 200 (success):

    $ curl -v --unix-socket /var/run/docker.sock http://localhost/v9999.9999/version
    *   Trying /var/run/docker.sock...
    * Connected to localhost (/Users/sebastiaan/Library/Containers/com.dock) port 80 (#0)
    > GET /v9999.9999/version HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.54.0
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Api-Version: 1.32
    < Content-Length: 240
    < Content-Type: application/json
    < Date: Tue, 10 Oct 2017 09:11:29 GMT
    < Docker-Experimental: true
    < Ostype: linux
    < Server: Docker/17.09.0-ce (linux)
    <
    {"Version":"17.09.0-ce","ApiVersion":"1.32","MinAPIVersion":"1.12","GitCommit":"afdb6d4","GoVersion":"go1.8.3","Os":"linux","Arch":"amd64","KernelVersion":"4.9.49-moby","Experimental":true,"BuildTime":"2017-09-26T22:45:38.000000000+00:00"}
    * Connection #0 to host localhost left intact

After this patch is applied, a 400 (Bad Request) is returned:

    $ curl -v --unix-socket /var/run/docker.sock http://localhost/v9999.9999/version
    *   Trying /var/run/docker.sock...
    * Connected to localhost (/var/run/docker.sock) port 80 (#0)
    > GET /v9999.9999/info HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.52.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Content-Type: application/json
    < Date: Tue, 10 Oct 2017 08:08:34 GMT
    < Content-Length: 89
    <
    {"message":"client version 9999.9999 is too new. Maximim supported API version is 1.34"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-10 11:17:48 +02:00
Sebastiaan van Stijn
a249ec36dd
API docs: add information about Content-Length header
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-09 01:43:10 +02:00
Frieder Bluemle
b80472cef4
Fix GitHub spelling
Signed-off-by: Frieder Bluemle <frieder.bluemle@gmail.com>
2017-10-07 00:10:24 +08:00
Sebastiaan van Stijn
288abf0854
Bump API version to 1.34
Docker 17.10 was cut off from ab2b03a0e1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-30 01:13:20 +02:00
Allen Sun
4611ecd3cd add node/service/secret/config specific event filter
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
2017-09-27 00:23:51 +08:00
Sebastiaan van Stijn
15a59e763b
Bump API version to 1.33
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-20 15:19:16 +02:00
Doug Davis
76a7f05795 Merge pull request #34594 from tizhou86/master
Fix typo in docs/api/version-history.md
2017-08-22 06:19:46 -07:00
Ti Zhou
a35bfd0b43 Fixed typo in docs/api/version-history.md
Signed-off-by: Ti Zhou <tizhou1986@gmail.com>
2017-08-22 16:47:08 +08:00
Christophe Vidal
dffa5d6df2 Dropped hyphen in bind mount where appropriate
Signed-off-by: Christophe Vidal <kriss@krizalys.com>
2017-08-19 21:25:07 +07:00
Kir Kolyshkin
7120976d74 Implement none, private, and shareable ipc modes
Since the commit d88fe447df ("Add support for sharing /dev/shm/ and
/dev/mqueue between containers") container's /dev/shm is mounted on the
host first, then bind-mounted inside the container. This is done that
way in order to be able to share this container's IPC namespace
(and the /dev/shm mount point) with another container.

Unfortunately, this functionality breaks container checkpoint/restore
(even if IPC is not shared). Since /dev/shm is an external mount, its
contents is not saved by `criu checkpoint`, and so upon restore any
application that tries to access data under /dev/shm is severily
disappointed (which usually results in a fatal crash).

This commit solves the issue by introducing new IPC modes for containers
(in addition to 'host' and 'container:ID'). The new modes are:

 - 'shareable':	enables sharing this container's IPC with others
		(this used to be the implicit default);

 - 'private':	disables sharing this container's IPC.

In 'private' mode, container's /dev/shm is truly mounted inside the
container, without any bind-mounting from the host, which solves the
issue.

While at it, let's also implement 'none' mode. The motivation, as
eloquently put by Justin Cormack, is:

> I wondered a while back about having a none shm mode, as currently it is
> not possible to have a totally unwriteable container as there is always
> a /dev/shm writeable mount. It is a bit of a niche case (and clearly
> should never be allowed to be daemon default) but it would be trivial to
> add now so maybe we should...

...so here's yet yet another mode:

 - 'none':	no /dev/shm mount inside the container (though it still
		has its own private IPC namespace).

Now, to ultimately solve the abovementioned checkpoint/restore issue, we'd
need to make 'private' the default mode, but unfortunately it breaks the
backward compatibility. So, let's make the default container IPC mode
per-daemon configurable (with the built-in default set to 'shareable'
for now). The default can be changed either via a daemon CLI option
(--default-shm-mode) or a daemon.json configuration file parameter
of the same name.

Note one can only set either 'shareable' or 'private' IPC modes as a
daemon default (i.e. in this context 'host', 'container', or 'none'
do not make much sense).

Some other changes this patch introduces are:

1. A mount for /dev/shm is added to default OCI Linux spec.

2. IpcMode.Valid() is simplified to remove duplicated code that parsed
   'container:ID' form. Note the old version used to check that ID does
   not contain a semicolon -- this is no longer the case (tests are
   modified accordingly). The motivation is we should either do a
   proper check for container ID validity, or don't check it at all
   (since it is checked in other places anyway). I chose the latter.

3. IpcMode.Container() is modified to not return container ID if the
   mode value does not start with "container:", unifying the check to
   be the same as in IpcMode.IsContainer().

3. IPC mode unit tests (runconfig/hostconfig_test.go) are modified
   to add checks for newly added values.

[v2: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-51345997]
[v3: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-53902833]
[v4: addressed the case of upgrading from older daemon, in this case
     container.HostConfig.IpcMode is unset and this is valid]
[v5: document old and new IpcMode values in api/swagger.yaml]
[v6: add the 'none' mode, changelog entry to docs/api/version-history.md]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-08-14 10:50:39 +03:00
Sebastiaan van Stijn
1a0fbc4a6f Merge pull request #34287 from thaJeztah/bump-api-version
Bump API version to 1.32
2017-08-01 12:18:26 +02:00
Sebastiaan van Stijn
c8dad44c32
Add API documentation for plugable secret backends
Documents the API changes introduced in

0304c98d85 and
08f7cf0526

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-28 00:00:53 +02:00
Sebastiaan van Stijn
05121d5554
Bump API version to 1.32
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-27 18:50:31 +02:00
Sebastiaan van Stijn
48a83a3a18
Update API history and example response for volume CreatedAt
This adds the new `CreatedAt` field to the API version history
and updates some examples to show this information.

The `CreatedAt` field was implemented in a46f757c40

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-19 16:18:08 +02:00
Sebastiaan van Stijn
d0a8e73e7b
Service privileges: API docs
This documents the Service privileges
API changes, that were added in:
091b5e68ea

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-14 17:04:26 -07:00
Sebastiaan van Stijn
e5862d42b3 Merge pull request #34065 from allencloud/add-cluster-events-change
add cluster events change in version_history.md
2017-07-11 20:28:05 -07:00
allencloud
e9da15a660 add cluster events change in version_history.md
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-07-12 09:25:30 +08:00
allencloud
c8d6477e5a add config event in swagger.yml
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-07-12 08:48:14 +08:00
Sebastiaan van Stijn
dd5e818fab
Fix api-version history
Commit c79c16910c
inadvertently put these API changes under API 1.31,
but they were added in API 1.30.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-10 21:15:02 -07:00
Brian Goff
72c3bcf2a5 Make plugin emit strongly typed, consumable events
Enables other subsystems to watch actions for a plugin(s).

This will be used specifically for implementing plugins on swarm where a
swarm controller needs to watch the state of a plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-07-06 14:26:06 -04:00
Sebastiaan van Stijn
9d95740dbf Merge pull request #33941 from thaJeztah/update-api-docs
Add missing API documentatoin for DataPathAddr
2017-07-05 18:35:45 -07:00
Sebastiaan van Stijn
c79c16910c
Add missing API documentatoin for DataPathAddr
COmmit 0307fe1a0b added
a new `DataPathAddr` property to the swarm/init and swarm/join
endpoints. This property was not yet added to the
documentation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-04 03:11:40 -07:00
Josh Soref
39bcaee47b
Spelling fixes
* additional
* ambiguous
* anonymous
* anything
* application
* because
* before
* building
* capabilities
* circumstances
* commit
* committer
* compresses
* concatenated
* config
* container
* container's
* current
* definition
* delimiter
* disassociates
* discovery
* distributed
* doesnotexist
* downloads
* duplicates
* either
* enhancing
* enumerate
* escapable
* exactly
* expect
* expectations
* expected
* explicitly
* false
* filesystem
* following
* forbidden
* git with
* healthcheck
* ignore
* independent
* inheritance
* investigating
* irrelevant
* it
* logging
* looking
* membership
* mimic
* minimum
* modify
* mountpoint
* multiline
* notifier
* outputting
* outside
* overridden
* override
* parsable
* plugins
* precedence
* propagation
* provided
* provides
* registries
* repositories
* returning
* settings
* should
* signals
* someone
* something
* specifically
* successfully
* synchronize
* they've
* thinking
* uninitialized
* unintentionally
* unmarshaling
* unnamed
* unreferenced
* verify

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-03 13:13:09 -07:00
Daniel Nephin
016eea004b
Set a LastUpdated time in image metadata when an image tag is updated.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-26 12:16:26 -07:00
Sebastiaan van Stijn
b8b8a9c837
Documentation updates for interactive sessions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-22 15:36:56 -07:00
Tibor Vass
b5579a4ce3 Remove docs (except docs/api), experimental/, contrib/completion, man/
They have been moved to github.com/docker/cli.

Signed-off-by: Tibor Vass <tibor@docker.com>
2017-06-14 03:14:46 +00:00
Aaron Lehmann
4310f7da7e Merge pull request #33630 from yongtang/167-cli-network-inspect-scope
Add `scope` filter in `GET /networks/(id or name)`
2017-06-12 18:27:24 -07:00
Yong Tang
158b2a1875 Add scope filter in /networks/<id>
This fix tries to add a `scope` in the query of `/networks/<id>`
(`NetworkInspect`) so that in case of duplicate network names,
it is possible to locate the network ID based on the network
scope (`local`, 'swarm', or `global`).

Multiple networks might exist in different scopes, which is a legitimate case.
For example, a network name `foo` might exists locally and in swarm network.

However, before this PR it was not possible to query a network name `foo`
in a specific scope like swarm.

This fix fixes the issue by allowing a `scope` query in `/networks/<id>`.

Additional test cases have been added to unit tests and integration tests.

This fix is related to docker/cli#167, moby/moby#30897, moby/moby#33561, moby/moby#30242

This fix fixes docker/cli#167

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-06-12 09:54:25 -07:00
Sebastiaan van Stijn
2b8f0eef73 Update docs, completion scripts for disable-legacy-registry
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-12 11:04:37 +02:00
Sebastiaan van Stijn
7839ff2244
Bump API version
With the Moby/Docker split, no decisions have been
made yet how, and when to bump the API version.

Although these decisions should not be lead
by Docker releases, I'm bumping the API version
to not complicate things for now; after this bump
we should make a plan how to handle this in future
(for example, using SemVer for the REST api, and
bump with every change).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-09 14:58:01 +02:00
Sebastiaan van Stijn
27ca921db1 Merge pull request #32122 from allencloud/choose-rpc-code-to-determine-status-code
choose rpc code to determine status code
2017-06-09 14:32:24 +02:00
Sebastiaan van Stijn
0ad3e3294e
Merge pull request #33572 from hsluoyz/patch-1
Add Casbin plugin to the list of Authorization plugins in docs.
(cherry picked from commit 220831d541)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-09 14:11:36 +02:00
Doug Davis
3eaec0071c
Merge pull request #32804 from bbodenmiller/patch-1
remove extra word
(cherry picked from commit 9db03bd8cd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-09 14:06:37 +02:00
Brian Goff
fcbd93f520
Merge pull request #32791 from djalal/patch-1
fix typo
(cherry picked from commit 32a52716b9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-09 14:06:31 +02:00
Sebastiaan van Stijn
8fd6547fc3
Merge pull request #32735 from bhavin192/patch-1
Add note about host-dir in VOLUME
(cherry picked from commit f2fff9d913)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-09 14:06:25 +02:00
Vincent Demeester
b4047a849b
Merge pull request #32724 from PatrickLang/patricklang-win-memory
Adding more on -m and --memory
(cherry picked from commit c3fbca1065)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-09 14:06:19 +02:00
Tõnis Tiigi
bc66821abb
Merge pull request #32684 from scjane/patch-3
Update builder.md
(cherry picked from commit 8310663377)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-09 14:06:13 +02:00
allencloud
f257f77c6c choose rpc code to determine status code
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-06-06 10:08:50 +08:00
Sebastiaan van Stijn
43239f62be
Update deprecated.md for removal of --email flag
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-01 17:05:42 +02:00
Alessandro Boch
d618b56b40 Docs and manual changes
- for service create on node-local networks

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-17 15:50:28 -07:00
Sebastiaan van Stijn
c053a2069e Merge pull request #32237 from jlhawn/update_container_wait
Update Container Wait
2017-05-17 02:39:52 +02:00
Sebastiaan van Stijn
03efb40cb8 Merge pull request #33152 from cyli/root-ca-rotation-cli-docs
Root CA rotation CLI docs
2017-05-17 02:17:27 +02:00
Sebastiaan van Stijn
a30ef99e8d Merge pull request #33151 from nwt/push-foreign-layers
Add daemon option to push foreign layers
2017-05-17 02:04:31 +02:00
Josh Hawn
4921171587 Update ContainerWait API
This patch adds the untilRemoved option to the ContainerWait API which
allows the client to wait until the container is not only exited but
also removed.

This patch also adds some more CLI integration tests for waiting for a
created container and waiting with the new --until-removed flag.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Handle detach sequence in CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Update Container Wait Conditions

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Apply container wait changes to API 1.30

The set of changes to the containerWait API missed the cut for the
Docker 17.05 release (API version 1.29). This patch bumps the version
checks to use 1.30 instead.

This patch also makes a minor update to a testfile which was added to
the builder/dockerfile package.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Remove wait changes from CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address minor nits on wait changes

- Changed the name of the tty Proxy wrapper to `escapeProxy`
- Removed the unnecessary Error() method on container.State
- Fixes a typo in comment (repeated word)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Use router.WithCancel in the containerWait handler

This handler previously added this functionality manually but now uses
the existing wrapper which does it for us.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Add WaitCondition constants to api/types/container

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

- Update ContainerWait backend interface to not return pointer values
  for container.StateStatus type.
- Updated container state's Wait() method comments to clarify that a
  context MUST be used for cancelling the request, setting timeouts,
  and to avoid goroutine leaks.
- Removed unnecessary buffering when making channels in the client's
  ContainerWait methods.
- Renamed result and error channels in client's ContainerWait methods
  to clarify that only a single result or error value would be sent
  on the channel.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Move container.WaitCondition type to separate file

... to avoid conflict with swagger-generated code for API response

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2017-05-16 15:11:39 -07:00
Noah Treuhaft
67fdf574d5 Add daemon option to push foreign layers
The --allow-nondistributable-artifacts daemon option specifies
registries to which foreign layers should be pushed.  (By default,
foreign layers are not pushed to registries.)

Additionally, to make this option effective, foreign layers are now
pulled from the registry if possible, falling back to the URLs in the
image manifest otherwise.

This option is useful when pushing images containing foreign layers to a
registry on an air-gapped network so hosts on that network can pull the
images without connecting to another server.

Signed-off-by: Noah Treuhaft <noah.treuhaft@docker.com>
2017-05-16 14:36:36 -07:00
Brian Goff
7b7f9a481e Merge pull request #33144 from nishanttotla/update-swarmkit-platform-structs
Adding Platforms field to TaskSpec Placement
2017-05-16 15:22:03 -04:00
Ying Li
3adddab957 Document the swarm root CA rotation CLI command.
Signed-off-by: Ying Li <ying.li@docker.com>
2017-05-15 17:21:01 -07:00
Sebastiaan van Stijn
f6c00f6e80 Merge pull request #33148 from cyli/doc-update-node-cluster-tls-info
Update the CLI docs to display whether a root rotation is in progress
2017-05-16 01:06:08 +02:00
Nishant Totla
1efbe6e876
Adding Platforms field to TaskSpec
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-05-15 14:58:20 -07:00
Sebastiaan van Stijn
4dbea104ca Merge pull request #33185 from tonistiigi/docs-build-target
docs: add docs for build —target
2017-05-15 22:14:54 +02:00
Tonis Tiigi
3377664e94 docs: add docs for build —target
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-15 09:56:53 -07:00
Kenfe-Mickaël Laventure
ba52bb0fd1 Merge pull request #32502 from tonistiigi/git-allow-pr-number
Allow specifying any remote ref in git checkout URLs
2017-05-15 09:34:54 -07:00
Sebastiaan van Stijn
99b5fadd0c Merge pull request #33184 from dnephin/doc-arg-before-from
Document arg before from
2017-05-15 13:35:23 +02:00
Daniel Nephin
83a4afe264 Document arg before from
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-05-12 18:45:08 -04:00
Tibor Vass
680084b2a2 Merge pull request #32874 from cpuguy83/metrics_plugins
Add support for metrics plugins
2017-05-12 15:44:34 -07:00
Aaron Lehmann
eb8abc9598 Merge pull request #32993 from cyli/root-rotation-cli
API changes to rotate swarm root CA
2017-05-12 10:12:32 -07:00
Brian Goff
0e8e8f0f31 Add support for metrics plugins
Allows for a plugin type that can be used to scrape metrics.
This is useful because metrics are not neccessarily at a standard
location... `--metrics-addr` must be set, and must currently be a TCP
socket.
Even if metrics are done via a unix socket, there's no guarentee where
the socket may be located on the system, making bind-mounting such a
socket into a container difficult (and racey, failure-prone on daemon
restart).

Metrics plugins side-step this issue by always listening on a unix
socket and then bind-mounting that into a known path in the plugin
container.

Note there has been similar work in the past (and ultimately punted at
the time) for consistent access to the Docker API from within a
container.

Why not add metrics to the Docker API and just provide a plugin with
access to the Docker API? Certainly this can be useful, but gives a lot
of control/access to a plugin that may only need the metrics. We can
look at supporting API plugins separately for this reason.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-05-12 00:30:09 -04:00
Ying Li
16c4b33774 Update the CLI docs to display whether a root rotation is in progress
when viewing system info, and TLS info when displaying node info.

Signed-off-by: Ying Li <ying.li@docker.com>
2017-05-11 10:48:22 -07:00