Commit Graph

705 Commits

Author SHA1 Message Date
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
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
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
b48cb728b8 Update client code with api changes
Using new methods from engine-api, that make it clearer which element is
required when consuming the API.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b9c94b70bf2f703f260844b3862a61f93dee6337
Component: engine
2016-04-15 12:48:01 +02:00
de95cbad37 Get events until a time in the past.
This change allow to filter events that happened in the past
without waiting for future events. Example:

docker events --since -1h --until -30m

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 55053d3537100eaeaad9c83b43e31f22d14fde7b
Component: engine
2016-04-14 16:22:16 -07:00
da8ff9f6e7 Merge pull request #21959 from coolljt0725/fix_21957
Fix docker load progressbar, fixes #21957
Upstream-commit: 348d90276802aac6c76126f2fe6866c521190ecd
Component: engine
2016-04-13 00:31:27 -04:00
94711fe63a Fix docker load progressbar, fixes #21957
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 96d7db665b06cc0bbede22d818c69dc5f6921f66
Component: engine
2016-04-12 22:45:42 -04:00
8194e834c4 Move middleware to interfaces.
This makes separating middlewares from the core api easier.
As an example, the authorization middleware is moved to
it's own package.

Initialize all static middlewares when the server is created, reducing
allocations every time a route is wrapper with the middlewares.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 8d3467626ee26cad48ad84f2181552dce7afccb6
Component: engine
2016-04-11 09:19:27 -07:00
956e3c675e Remove reference package dependency from the api.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 47afe6bd0a0dc806c36d0978a8d3e23f75ef87fe
Component: engine
2016-04-07 15:01:23 -07:00
97016757fb Let client print error when speicify wrong detach keys
Fix #21064

Let client print error message explicitly when user specifies wrong
detach keys.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 91e5bb954131904af150b06bd22b007559a8ce27
Component: engine
2016-04-04 15:35:55 +08:00
7497562d8e Fix race between with event timer stopping early
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: b38cee9f9c79d1f12001348303b78462d99664ed
Component: engine
2016-03-31 09:49:07 -07:00
b960646c00 Remove builder dependency from the api.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: d12b7c7e3e5566f49f81189b757bcd0e4ef09956
Component: engine
2016-03-29 17:02:36 -07:00
922dd0a9e8 Merge pull request #21586 from calavera/remove_runconfig_from_routes
Remove runconfig package dependency from the API.
Upstream-commit: 1da40fb4badd116a7591dd2c19009146770c9a89
Component: engine
2016-03-29 08:40:49 -07:00
56103ffaad Remove runconfig package dependency from image and container routers.
Use an interface to specify the behavior of a configuration decoder.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: f0d26e1665f7552972db5b041554cc7b45bc3060
Component: engine
2016-03-28 16:23:51 -04:00
91e6a2df59 Remove runconfig dependency from network routes.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 3ca29823d42ab1e2b1ea76981ccc9aa11e858cb2
Component: engine
2016-03-28 16:23:50 -04:00
1660794bad Merge pull request #21523 from LK4D4/cancellable_routes
Embed context.Context to routes with usage of CloseNotify
Upstream-commit: be390c30cdde978ea1a5417875876e4f3ae52655
Component: engine
2016-03-28 12:44:07 -07:00
406cc47308 use router.Cancellable for pull and push
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c6ad1980a2eb2994940bdf7f79835ffdbed2b44d
Component: engine
2016-03-27 21:53:25 -07:00
ccb887dc36 Extend Docker authorization with TLS user information
Currently Docker authorization framework does not use any user
information, which already available in the Docker context for TLS
connection.
The purpose of this CR is to complete the existing authz work by adding
the basic client certificate details (SUBJECT_NAME) and authentication
method (TLS) to the authz request.

We think this should be the default behavior when no extended
authorization module is specified (currently WIP under #20883).

Signed-off-by: Liron Levin <liron@twistlock.com>
Upstream-commit: 3c157713b31f542a4180e31da4cae7d677330a6f
Component: engine
2016-03-27 15:53:55 +03:00
4948749e40 use router.Cancellable instead of direct CloseNotify
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 62c9e62edcf3d96d251fd06a48437b2fa2f56ad6
Component: engine
2016-03-25 11:33:54 -07:00
f7d7f8e5e6 Merge pull request #21468 from coolljt0725/remove_useless_log
Do not return error on hijacked connection for docker exec
Upstream-commit: e2221d1f37d1204ccca51722aa21fc11939a41ba
Component: engine
2016-03-25 10:50:43 -07:00
96f77f179c api/server/router: add Cancellable function
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: bdd9388c4262d228c57ce637a8e6fad003684df1
Component: engine
2016-03-25 10:19:23 -07:00
43dd16ffb4 builder: replace cancelled channel with net/context
Also stop execution of run immediately if request was cancelled.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: f2401a0f6960734093be307a27bba85a3c2ecfcd
Component: engine
2016-03-25 08:19:29 -07:00
d3972744c1 Merge pull request #21456 from calavera/remove_unecessary_hardcoded_version
Remove unnecessary hardcoded version.
Upstream-commit: 6748ecb0050f2c6a9a57e824f23b5b4afb35240d
Component: engine
2016-03-24 14:31:59 -07:00
2257ef7e0a Remove unnecessary hardcoded version.
The server configuration already keeps the current version
if the daemon. This patch changes the middleware logic
to use it rather than using the global value.

This removes the dockerversion package dependency from the api.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: accf28a7dbdd46203c661d30b80326df4d447cea
Component: engine
2016-03-24 12:33:40 -04:00
afd62f19a9 Do not return error on hijacked connection for docker exec
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: d6ccc0e09fe42d9f0d929dbf8d68ce790f4c8b9e
Component: engine
2016-03-24 08:52:13 -04:00