Commit Graph

727 Commits

Author SHA1 Message Date
a603b90d7f Add --force in docker volume rm to fix out-of-band volume driver deletion
This fix tries to address the issue in raised #23367 where an out-of-band
volume driver deletion leaves some data in docker. This prevent the
reuse of deleted volume names (by out-of-band volume driver like flocker).

This fix adds a `--force` field in `docker volume rm` to forcefully purge
the data of the volume that has already been deleted.

Related documentations have been updated.

This fix is tested manually with flocker, as is specified in #23367.
An integration test has also been added for the scenario described.

This fix fixes #23367.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 6c5c34d50d377d1c5318a255240fb2dc9c23cf92
Component: engine
2016-08-18 18:01:25 -07:00
294f10b578 Don't confuse with empty body
It fails with any (even empty) json request body.

Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com>
Upstream-commit: 57db05cb1031f6a01e1568ceb16434e5809aef81
Component: engine
2016-08-17 02:01:04 +03:00
a0933c7d27 Merge pull request #25721 from cpuguy83/revendor_engine-api
revendor engine-api
Upstream-commit: 37302bbb3f4889e9de2a95d5ea018acdab9e4447
Component: engine
2016-08-16 17:18:43 -04:00
3dcc0abf19 revendor engine-api
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 6d98e344c7702a8a713cb9e02a19d83a79d3f930
Component: engine
2016-08-16 14:16:12 -04:00
720eb363bf Merge pull request #25564 from coolljt0725/fix_inspect_network
Fix inspect network show gateway with mask
Upstream-commit: d8240c8e27b625c6c2b7982e2473cce46e2a9ddc
Component: engine
2016-08-12 11:11:09 +02:00
8eacfa50f9 Fix inspect network show gateway with mask
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 096bb5fb0740656b91b3e35f8df23c79270f7f90
Component: engine
2016-08-11 21:08:54 -04:00
139163d715 Return application/json for image/load API (quite=1)
This fix tries to address the issue raised in 25529 wehre the
image/load API returns `application/json` for quiet=0 and
`text/plain` for quite=1.

This fix makes the change so that `application/json` is returned
for both quiet=0 and quite=1.

This fix has been tested manually.

This fix fixes 25529.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 2f27632cde2f0e514bd3a8de77cc1934e5193a83
Component: engine
2016-08-09 17:55:42 -07:00
d5f439ee89 Add --force to docker plugin remove
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 0016b331dac94661678fd7676c7b6ccc9ec2d147
Component: engine
2016-08-04 15:55:45 -07:00
86ea274c7e Mask join tokens in daemon logs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e3917c76ce6f75e6c12cd2099d403fdaba8ab218
Component: engine
2016-08-02 15:15:23 -07:00
0e5400a423 Add --force to node removal
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
Upstream-commit: a327c231b5c68c13b7dcde2fdc83b8e4cec59c43
Component: engine
2016-08-01 18:55:58 -07:00
e8d1954574 Merge pull request #24365 from xianlubird/bug/network-list
Change buildEndpointResource params avoid repeat visits resource
Upstream-commit: 6bf2db574bb7482b7abce23ef992ff15b6011458
Component: engine
2016-07-29 14:54:05 -04:00
f82a46e7d6 make network errors less DRY
There's existing code to generate these
kind of errors, so make the errors added
in commit cc493a52a46271df82dbebea26038502b85788b9
less DRY.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3fa9d77bf312652ae04e902a2b6e73a0b91ec007
Component: engine
2016-07-25 16:22:08 +02:00
a4faf39b6e Add new error to API docs
Commit cc493a52a46271df82dbebea26038502b85788b9 added
a constraint to network connect/disconnect operations
on "Swarm scoped" networks.

This adds those errors to the API documentation. Also
changes the error to lowercase for consistency.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b0089e48272f18d856ba147b393371c18d5683fb
Component: engine
2016-07-25 12:04:55 +02:00
cf6ff5cc28 Prevent network connect/disconnect on swarm scoped networks
Swarm handles service updates quite differently and also it doesnt
support worker driver network operations. Hence prevent containers from
connecting to swarm scoped networks

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 8f9066c468d7312af722c7cf9fc27b7c8ab79fc3
Component: engine
2016-07-24 15:34:45 -07:00
411f901924 Change "rotate_worker_token" to "rotateWorkerToken"
This renames the `rotate_xxx` flags to camelBack, for
consistency with other API query-params, such as
`detachKeys`, `noOverwriteDirNonDir`, and `fromImage`.

Also makes this flag accept a wider range of boolean
values ("0", "1", "true", "false"), and throw an error
if an invalid value is passed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bd81df12780b0765e55582574eaa2a125adf65fa
Component: engine
2016-07-23 01:04:12 +02:00
b141a44de0 Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 2cc5bd33eef038bf5721582e2410ba459bb656e9
Component: engine
2016-07-21 15:23:03 -07:00
5046fa8daa Change buildEndpointResource params avoid repeat visits resource
Signed-off-by: Xianlu <xianlu.cxl@alibaba-inc.com>
Upstream-commit: 5b681c96b0315fbb5ffed652df53c07886f0235a
Component: engine
2016-07-06 17:55:02 +08:00
e4dfc2d04c Validate hostname starting from 1.24 API.
In order to keep a little bit of "sanity" on the API side, validate
hostname only starting from v1.24 API version.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6daf3d2a783fd042e870c8af8bbd19fc28989505
Component: engine
2016-07-06 09:13:59 +02:00
48bf87974d Merge pull request #24158 from mavenugo/smissues
Fixed a few network UI issues in swarm-mode
Upstream-commit: 5b4131681595b6f5304f3d94868a1642f92f2998
Component: engine
2016-07-05 20:28:20 +00:00
4306c5def3 Merge pull request #24191 from tonistiigi/mask-secrets
Mask swarm secrets from daemon logs
Upstream-commit: 55b8216279b40f6712ccdd46a6e2ac73c4bdbba0
Component: engine
2016-07-05 08:56:33 -07:00
e32550579c Merge pull request #23584 from nishanttotla/private-images-swarm-services
Passing registry auth token for service create, update
Upstream-commit: 8fe6480c8a26f80fe174ae93e1b380bb7ec6083c
Component: engine
2016-06-30 17:18:59 -07:00
c8d0fdbe96 Mask swarm secrets from daemon logs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 8b8f86aec95ec73881c2dfb6e990784014d61e6e
Component: engine
2016-06-30 17:11:09 -07:00
9f0a770513 Adding a flag to specify sending of registry auth
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 538bac39d7fe93562922b89e9a294096be48fb59
Component: engine
2016-06-30 14:59:32 -07:00
3b186ee015 Fixed a few network UI issues in swarm-mode
* Detect name conflicts on network creation
* Detect and prevent network connect/disconnect for managed containers

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 0ce5158a2a9a3f10a62d3c1ea289c55e524cdac5
Component: engine
2016-06-29 18:08:55 -07:00
cddb6e635c Updating header name and executor
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: af5df117a805c8df661c7efa58c57680019b5752
Component: engine
2016-06-29 13:26:19 -07:00
4850c6643f Return an empty network list if nothing matches filter
Initializing the network list struct in order to return an empty list
instead of a nil object.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a7043ac5c423cf68d4f92024e694887099640d91
Component: engine
2016-06-29 00:06:44 +02:00
b75c9d3100 Passing registry auth token for service create and update
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 93ec5cda55e78dbb683b59bde244a7984b323574
Component: engine
2016-06-28 13:53:01 -07:00
852cc7fc30 Fixing typo on service log output.
Signed-off-by: Adam Avilla <aavilla@yp.com>
Upstream-commit: 7cc6fe575895dca6c50c4eadb0fd4c4986d05048
Component: engine
2016-06-23 14:54:40 -07:00
44cb4a4db6 api,daemon: cleanup some unused stuff
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: ed5d335e22143b35f928e5a8740b046c21db808b
Component: engine
2016-06-21 14:15:19 -07:00
848e510213 plugins: experimental support for new plugin management
This patch introduces a new experimental engine-level plugin management
with a new API and command line. Plugins can be distributed via a Docker
registry, and their lifecycle is managed by the engine.
This makes plugins a first-class construct.

For more background, have a look at issue #20363.

Documentation is in a separate commit. If you want to understand how the
new plugin system works, you can start by reading the documentation.

Note: backwards compatibility with existing plugins is maintained,
albeit they won't benefit from the advantages of the new system.

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: f37117045c5398fd3dca8016ea8ca0cb47e7312b
Component: engine
2016-06-14 14:20:27 -07:00
be63983b3a Add Swarm management backend
As described in our ROADMAP.md, introduce new Swarm management API
endpoints relying on swarmkit to deploy services. It currently vendors
docker/engine-api changes.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 534a90a99367af6f6bba1ddcc7eb07506e41f774
Component: engine
2016-06-13 22:16:18 -07:00
04ae4edf2f Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

This fix fixes #23459.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a72b45dbec3caeb3237d1af5aedd04adeb083571
Component: engine
2016-06-11 13:16:55 -07:00
ecda48bde7 Return remote API errors as JSON
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: 322e2a7d059a81617b593cf6ece2cfd9f6d4ea03
Component: engine
2016-06-07 18:45:27 -07:00
27654930fa Deprecate /containers/(id or name)/copy endpoint
This endpoint has been deprecated since 1.8. Return an error starting
from this API version (1.24) in order to make sure it's not used for the
next API version and so that we can remove it some times later.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 428328908dc529b1678fb3d8b033fb0591a294e3
Component: engine
2016-06-03 19:38:03 +02:00
604319f9f2 Merge pull request #23107 from yongtang/23055-docker-search-limit
Add `--limit` option to `docker search`
Upstream-commit: 020a86b3d9e6b052a3f866b7517eb0f62fd24bea
Component: engine
2016-06-03 14:25:42 +02:00
a0ddbe99db Merge pull request #22715 from allencloud/add-trace-http-pprof
add trace in docker engine's pprof to show execution trace in binary form
Upstream-commit: 766550385dac63c19a9af683c5d56c2875f5cabe
Component: engine
2016-06-03 13:22:13 +02:00
82d7e1ba5d Add --limit option to docker search
This fix tries to address the issue raised in #23055.
Currently `docker search` result caps at 25 and there is
no way to allow getting more results (if exist).

This fix adds the flag `--limit` so that it is possible
to return more results from the `docker search`.

Related documentation has been updated.

Additional tests have been added to cover the changes.

This fix fixes #23055.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 92f10fe228c1b4b527b87ac47401132322283ea3
Component: engine
2016-06-02 19:12:20 -07:00
5578aba972 Merge pull request #23193 from allencloud/fix-typos
use grep to find all a/an typos
Upstream-commit: 98c245c9e63793cf8ca03c5500e0820447c1861c
Component: engine
2016-06-02 18:45:08 -07:00
4524589dc5 Add support for user-defined healthchecks
This PR adds support for user-defined health-check probes for Docker
containers. It adds a `HEALTHCHECK` instruction to the Dockerfile syntax plus
some corresponding "docker run" options. It can be used with a restart policy
to automatically restart a container if the check fails.

The `HEALTHCHECK` instruction has two forms:

* `HEALTHCHECK [OPTIONS] CMD command` (check container health by running a command inside the container)
* `HEALTHCHECK NONE` (disable any healthcheck inherited from the base image)

The `HEALTHCHECK` instruction tells Docker how to test a container to check that
it is still working. This can detect cases such as a web server that is stuck in
an infinite loop and unable to handle new connections, even though the server
process is still running.

When a container has a healthcheck specified, it has a _health status_ in
addition to its normal status. This status is initially `starting`. Whenever a
health check passes, it becomes `healthy` (whatever state it was previously in).
After a certain number of consecutive failures, it becomes `unhealthy`.

The options that can appear before `CMD` are:

* `--interval=DURATION` (default: `30s`)
* `--timeout=DURATION` (default: `30s`)
* `--retries=N` (default: `1`)

The health check will first run **interval** seconds after the container is
started, and then again **interval** seconds after each previous check completes.

If a single run of the check takes longer than **timeout** seconds then the check
is considered to have failed.

It takes **retries** consecutive failures of the health check for the container
to be considered `unhealthy`.

There can only be one `HEALTHCHECK` instruction in a Dockerfile. If you list
more than one then only the last `HEALTHCHECK` will take effect.

The command after the `CMD` keyword can be either a shell command (e.g. `HEALTHCHECK
CMD /bin/check-running`) or an _exec_ array (as with other Dockerfile commands;
see e.g. `ENTRYPOINT` for details).

The command's exit status indicates the health status of the container.
The possible values are:

- 0: success - the container is healthy and ready for use
- 1: unhealthy - the container is not working correctly
- 2: starting - the container is not ready for use yet, but is working correctly

If the probe returns 2 ("starting") when the container has already moved out of the
"starting" state then it is treated as "unhealthy" instead.

For example, to check every five minutes or so that a web-server is able to
serve the site's main page within three seconds:

    HEALTHCHECK --interval=5m --timeout=3s \
      CMD curl -f http://localhost/ || exit 1

To help debug failing probes, any output text (UTF-8 encoded) that the command writes
on stdout or stderr will be stored in the health status and can be queried with
`docker inspect`. Such output should be kept short (only the first 4096 bytes
are stored currently).

When the health status of a container changes, a `health_status` event is
generated with the new status. The health status is also displayed in the
`docker ps` output.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b6c7becbfe1d76b1250f6d8e991e645e13808a9c
Component: engine
2016-06-02 23:58:34 +02:00
35c5774373 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: c1be45fa38e82054dcad606d71446a662524f2d5
Component: engine
2016-06-02 17:17:22 +08:00
67d0b2dc23 remove deprecated feature of passing HostConfig at API container start
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: 0a8386c8be3fa87b7523bef7fd31c81a7f84709c
Component: engine
2016-06-01 22:25:17 +08:00
214a2bf487 Add a --filter option to docker search
The filtering is made server-side, and the following filters are
supported:

* is-official (boolean)
* is-automated (boolean)
* has-stars (integer)

Signed-off-by: Fabrizio Soppelsa <fsoppelsa@mirantis.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: e009ebdf4c0bf0ff64da8d48eefad63d0644de3e
Component: engine
2016-05-20 13:41:28 +02:00
b96d544c7a Fix bug which mistakes 400 error for 500
Signed-off-by: Wang Xing <hzwangxing@corp.netease.com>
Upstream-commit: beca2615782e24fa28803ada067129fdfa88c77d
Component: engine
2016-05-19 20:01:55 +08:00
a0525f7103 add trace in docker engine's pprof to show execution trace in binary form
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 8879458faab9ed1122cc1f00c15680bfd82705dd
Component: engine
2016-05-13 15:24:44 +08:00
697f71e4f2 Add support for reading logs extra attrs
The jsonlog logger currently allows specifying envs and labels that
should be propagated to the log message, however there has been no way
to read that back.

This adds a new API option to enable inserting these attrs back to the
log reader.

With timestamps, this looks like so:
```
92016-04-08T15:28:09.835913720Z foo=bar,hello=world hello
```

The extra attrs are comma separated before the log message but after
timestamps.

Without timestaps it looks like so:
```
foo=bar,hello=world hello
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: bd9d14a07b9f1c82625dc8483245caf3fa7fe9e6
Component: engine
2016-05-06 20:42:20 -04:00
1f29278b9e Fix bug: exec non-exist command miss a "\n"
When exec a non-exist command, it should print a newline at last.

Currently:
```
$ docker exec -ti f5f703ea2c0a144 bash
rpc error: code = 2 desc = "oci runtime error: exec failed: exec:
\"bash\": executable file not found in $PATH"$
```

Signed-off-by: Feng Yan <fy2462@gmail.com>
Upstream-commit: 8bf5613c1aca634e517e895e90e74f4263cf030f
Component: engine
2016-04-28 16:39:00 +08:00
b1397d2034 api: server: check for unauthorized error
This functionality has been fixed by
7bca93218291767c5dd8782de0ad630dbcda9995 but then it has been broken
again by a793564b2591035aec5412fbcbcccf220c773a4c and finally refixed
here.

Basically the functionality was to prompt for login when trying to pull
from the official docker hub.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 4316ae2ed33d158e1d8d994646a75e25a70d9320
Component: engine
2016-04-22 17:14:02 +02:00
03d17b8c5f Update code for latest engine-api
- Update CopyToContainer uses
- Use engine-api/types/versions instead of pkg/version

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 7534f17261d0bb74557ca2f7cd893d5b7b531d49
Component: engine
2016-04-19 16:56:54 +02:00
f8a8c81f4e Merge pull request #21657 from vdemeester/update-engine-api
Update engine api with required arguments
Upstream-commit: 7fd53f7c711474791ce4292326e0b1dc7d4d6b0f
Component: engine
2016-04-18 19:47:22 -07:00
8d9f1bcb22 Merge pull request #21939 from calavera/events_until_past
Get events until a time in the past.
Upstream-commit: 19a453e6b40177af31703f107131aae5ca81adf2
Component: engine
2016-04-15 15:33:41 -04:00