Commit Graph

23043 Commits

Author SHA1 Message Date
69ba7aeaeb Add a check for size field in custom format string
This fix addresses an issue where including the `{{.Size}}` format
field in conjunction with `docker ps --format`, without the `--size`
flag, would not correctly display the size of containers.

This is done by doing a check on the custom format string, and setting
the size flag on the options struct if the field is found. This struct
gets passed to the engine API which then generates the correct query.

An integration test is included which runs `docker ps --format "table
{{.Size}}"` without `--size`, and checks that the returned output is
not `0 B`.

Fixes #21991

As suggested by @cpuguy83, a parser is implemented to process the format
string as a template, and then traverses the template tree to determine
if `.Size` was called.

This was then reworked by making use of template execution with a
pre-processor struct that will set the `--size` option if the template
calls for the field.

The pre-processor now also sets a boolean in the context passed to the
writer. There is an integration test for this that calls `docker ps
--size --format "{{.Size}}"` and then checks that `size: {{.Size}}` is
not appended, as it would with previous behavior.

Finally, a change was made to the formatter to not automatically
add a `{{.Size}}` if a custom format is provided.

Signed-off-by: Paulo Ribeiro <paigr.io@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 55cdb6dcd0f709301573ddb9f3348f9288572b91
Component: engine
2016-06-03 21:59:10 +02:00
79342b784b Merge pull request #22898 from WeiZhang555/add-detach-event
Add detach event
Upstream-commit: c80a2f2937463882c2c38141a710f19b608125e6
Component: engine
2016-06-03 09:49:48 -07:00
10f297b70b Merge pull request #23239 from albers/completion-run-healthcheck
bash completion for `docker run` healthcheck options
Upstream-commit: 5429f4ef6166a593fc9d2e6dd4f689d4ff94b2b7
Component: engine
2016-06-03 18:17:15 +02:00
2eea0b819d bash completion for docker run healthcheck options
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: f738e6a732aac706ceeb5d6d02ac61d7f780e1fd
Component: engine
2016-06-03 17:04:04 +02:00
8bc106635e bash completion for docker search --limit
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 4b5ccd73426bcaedd69ae9f740cfaf6250276ffa
Component: engine
2016-06-03 16:32:37 +02:00
d64411abc7 Merge pull request #23222 from yongtang/06022016-add-missing-links-in-deprecated-docs
Add missing links in deprecated.md
Upstream-commit: 147c8b7495c0a28f741abacc928486e108d8e4a9
Component: engine
2016-06-03 15:16:11 +02:00
1d2d19ec51 Merge pull request #23215 from BlackYoup/pkg-config
make.sh: use PKG_CONFIG environment variable if it exists
Upstream-commit: 726ef47d5c50c329b5b0c30f3a0612cc7ee241b3
Component: engine
2016-06-03 15:04:37 +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
768de748a7 Merge pull request #23111 from yongtang/20083-dockerignore-comment
Add support for comments in .dockerignore
Upstream-commit: 9c1278b279b3253c8c4aafecdef74bffea3edc58
Component: engine
2016-06-03 14:23:09 +02:00
14f34960c4 Merge pull request #23227 from yongtang/06032016-engine-api
Vendor engine-api to 5d8739372315f8147ceb7bcc53576893ff96ffc6
Upstream-commit: f1755b256070f7654ab958523cee5fbbe0f10d1d
Component: engine
2016-06-03 14:15:31 +02:00
59a476f30d Merge pull request #23230 from thaJeztah/carry_make_install_binary
[carry 22927] Add `make install` task
Upstream-commit: 613286859f132b9017682f717329b087fedd2190
Component: engine
2016-06-03 13:53: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
c85ea51dd0 Fix double entry in authors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0829581d7ea97d7d931527c872dbf9921757f497
Component: engine
2016-06-03 12:40:36 +02:00
56f0d7968e Add make install task
This installs docker and dockerd to `$DOCKER_MAKE_INSTALL_PREFIX/bin`, which
defaults to `/usr/local/bin`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9bb54f89ad26015c79dab7c5ac210cb846e0713b
Component: engine
2016-06-03 12:08:33 +02:00
911ef54d71 Vendor engine-api to 5d8739372315f8147ceb7bcc53576893ff96ffc6
This fix tries to update engine-api to 5d8739372315f8147ceb7bcc53576893ff96ffc6

This fix brings engine-api up to date, which includes changes from:
https://github.com/docker/engine-api/pull/256
https://github.com/docker/engine-api/pull/254

This fix is related to

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 10c35196b19389da5bb64921b7e1f23eb054c739
Component: engine
2016-06-03 02:27:17 -07:00
37a5f59dad Merge pull request #23173 from thaJeztah/update-authors
Update mailmap and re-generate Authors
Upstream-commit: a11d40af9bcfefb12839127cc46aa8b25a5d3a6f
Component: engine
2016-06-03 10:20:33 +02:00
215e6ac73a Merge pull request #23220 from icecrime/bump_etcd_2.3.2
Bump etcd to 2.3.2
Upstream-commit: b16f735e9060f1561e81ad8f02afc51ba96c39f0
Component: engine
2016-06-02 22:04:35 -07:00
57f1cfe3b1 Add detach event
If we attach to a running container and stream is closed afterwards, we
can never be sure if the container is stopped or detached. Adding a new
type of `detach` event can explicitly notify client that container is
detached, so client will know that there's no need to wait for its exit
code and it can move forward to next step now.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 83ad006d4724929ccbde4bdf768374fad0eeab44
Component: engine
2016-06-03 11:59:11 +08:00
98c708dda0 Add missing links in deprecated.md doc.
This fix tries to address several issues in deprecated.md:
1. For deprecated and removal versions, some include link reference
to the release tag but some does not point to the release tag. This
fix adds the missing links as long as the version is <= 1.12.
2. Technically, 1.12 is not released yet so the link to 1.12 does
not exist yet. However, at the time 1.12 is released this
deprecated.md doc should have been part of the release as well.
There is a circular dependency. This fix adds 1.12 for now.
3. `HostConfig at API container start` has already been removed
by #22570 so this fix changes `Target For Removal In Release: v1.12`
to `Removed In Release: v1.12`.
4. `Docker search 'automated' and 'stars' options` has not been removed
yet so this fix changes `Removed In Release: v1.14` to
`Target For Removal In Release: v1.14`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 7bc9e0aebbddb934f14ce287f0c3b419663cb480
Component: engine
2016-06-02 19:54:35 -07: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
3dff30ced8 Add support for comment in .dockerignore
This fix tries to address the issue raised in #20083 where
comment is not supported in `.dockerignore`.

This fix updated the processing of `.dockerignore` so that any
lines starting with `#` are ignored, which is similiar to the
behavior of `.gitignore`.

Related documentation has been updated.

Additional tests have been added to cover the changes.

This fix fixes #20083.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8913dace341c8fc9f9a3ab9518c8521c161b307f
Component: engine
2016-06-02 19:06:52 -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
25e7113b7c Bump etcd to 2.3.2
Bump etcd to 2.3.2 and `github.com/ugorji/go` accordingly.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: f02ffd9e19acb3cc0a0ea6e58a8944be60f249e1
Component: engine
2016-06-02 18:35:45 -07:00
2d822126c6 Merge pull request #23192 from orsenthil/docfixes/ubuntu_install
Fix the docker daemon restart command for ubuntu.
Upstream-commit: e2528712db8b904de0ae7c076a3ddcf163a2734d
Component: engine
2016-06-02 18:05:49 -07:00
6cdb4b4ed9 Merge pull request #22763 from zreigz/doc-multiple-daemons
Add documentation for running multiple daemons
Upstream-commit: 9be8f04950f918b91e3d4166597e9e2eee74fbd6
Component: engine
2016-06-02 18:01:02 -07:00
86b8394801 Merge pull request #23026 from rhatdan/mkdir
Need to create bind mount volume if it does not exist.
Upstream-commit: 850031c581d37b13032d990eae07027901c02873
Component: engine
2016-06-02 20:45:33 -04:00
de2ab87c91 Merge pull request #23136 from nalind/logscmd_read_journald_attrs
Add support for reading journal extras details, and setting timestamps to UTC
Upstream-commit: 94b2d3554c84f33a598a36ba38038f7bbcd97e43
Component: engine
2016-06-02 20:42:24 -04:00
b7559c81f8 Bump engine-api to fa04f66c7871183dd53a5ec666479f49b452743d
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 76d8b0dab76610526b28a657ac13db6f8c89c0e1
Component: engine
2016-06-03 00:14:55 +02: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
805e334e2c Merge pull request #23212 from LK4D4/remove_unused_var
pkg/parser/kernel: remove unused var block
Upstream-commit: d1b1b6a98ef5381d2f3702d2c11856f692a0a412
Component: engine
2016-06-02 16:30:05 -04:00
44649a5cdf Merge pull request #23140 from Microsoft/HcsshimRevendor
Revendor hcsshim
Upstream-commit: eb9274844efd5e08226a98de79f0f5237a6e2458
Component: engine
2016-06-02 22:09:19 +02:00
22121ca2b2 Use PKG_CONFIG environment variable if it exists
pkg-config is not always available in the path
so let people choose where it's located

Signed-off-by: Arnaud Lefebvre <a.lefebvre@outlook.fr>
Upstream-commit: 20bf00dfa56ef9584d25777031ac4d11360386a8
Component: engine
2016-06-02 21:53:28 +02:00
bc51dad73c Merge pull request #23206 from mlaventure/fix-release-deb
Fix release-deb script
Upstream-commit: 4399d3b309a5af06471382ecf22c40f24d218c73
Component: engine
2016-06-02 21:22:49 +02:00
293f9965b9 Merge pull request #22806 from errordeveloper/master
Remove MountFlags in systemd unit to allow shared mount propagation
Upstream-commit: 791f98290e0e88c76cb916d6e1d211467f36e230
Component: engine
2016-06-02 20:04:08 +02:00
f525106e1c pkg/parser/kernel: remove unused var block
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6e5894b5511846b1be64f6fcae73a8b4ddd0ef24
Component: engine
2016-06-02 10:50:36 -07:00
53602a37d4 Merge pull request #22549 from allencloud/make-pkg-parsers-support-darwin
add darwin support in package docker/pkg/parsers
Upstream-commit: 34f54b3a11291b70b4316c2b4e047d8aafa95bed
Component: engine
2016-06-02 10:48:19 -07:00
1d1d68b640 Merge pull request #23208 from vdemeester/update-engine-api
Bump engine api to 009ba16
Upstream-commit: cb8e7470be022e55653e5472c72ee73ec5fc1bc6
Component: engine
2016-06-02 09:30:57 -07:00
c30ea46ede Fix release-deb script
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: afc2579d1a5aa3b95d90d6a1fdf7d6a4e3058fd6
Component: engine
2016-06-02 08:53:33 -07:00
eaf6e81896 Merge pull request #23153 from AkihiroSuda/fix23152PkgGitutils
Fix gitconfig dependency in pkg/gitutils.TestCheckoutGit
Upstream-commit: f69353a364e0ec6ddb0cff3991ee0b44d87285c1
Component: engine
2016-06-02 17:21:38 +02:00
b9498f5bad Merge pull request #23179 from kerneltime/master
Add VMware Docker Volume Plugin.
Upstream-commit: 09033b8df223c3d3ea1fc97bc86cd6f23e1cdfc3
Component: engine
2016-06-02 17:05:32 +02:00
f9f967f68a Update ContainerStart calls to use options now
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6b7f12650d8333bf088271acecea5256aef99c41
Component: engine
2016-06-02 16:56:13 +02:00
27ed0fbcf5 Update engine-api to 009ba1641d669613b38818f6f6385b0e74c5728f
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8ea051f01261c44512bcaa76569a7fb9a200bab6
Component: engine
2016-06-02 16:55:49 +02:00
04d8138246 Add support for reading journal extras and in UTC
When told to read additional attributes from logs that we've sent to the
journal, pull out all of the non-trusted, non-user fields that we didn't
hard-code ourselves.  More of PR#20726 and PR#21889.

When reading entries in the journald log reader, set the time zone on
timestamps that we read to UTC, so that we send UTC values to the client
instead of values that are local to whatever timezone dockerd happens to
be running in.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
Upstream-commit: 0da0a8f9dae35e6a9cb63b9e4a3285e24c001af3
Component: engine
2016-06-02 10:17:07 -04:00
eceb2f3e2e Merge pull request #23183 from caarlos0/permissions
Removed exec permissions from Dockerfile.windows
Upstream-commit: 80b3e9e8103f0898296de6140149050877eecea3
Component: engine
2016-06-02 16:10:37 +02:00
bd8dbcc1e8 Merge pull request #22460 from jwhonce/wip/sigpipe
Ignore SIGPIPE events
Upstream-commit: 171af5493121bada5c0e8167ade44da52648d0e2
Component: engine
2016-06-02 16:05:22 +02:00
3bf6a7fe89 Merge pull request #23161 from AkihiroSuda/rename-misleading-function-name
daemon: Rename copy to copyFunc
Upstream-commit: 0aeac288a33e498ad6bfa5a91f044a469c78a138
Component: engine
2016-06-02 15:31:08 +02:00
ab8e2e8aee Need to create bind mount volume if it does not exist.
In order to be consistent on creation of volumes for bind mounts
we need to create the source directory if it does not exist and the
user specified he wants it relabeled.

Can not do this lower down the stack, since we are not passing in the
mode fields.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 322cc99c6962ecb56be3107061eb7f61364d05f8
Component: engine
2016-06-02 07:14:17 -04:00
ce5b5efc4f Merge pull request #23121 from unclejack/disallow_ecryptfs_aufs
aufs,overlay: disable on eCryptfs
Upstream-commit: 22aca92ee3503f811f813be4a1349ad8e67fbbdb
Component: engine
2016-06-02 12:54:43 +02:00
3791819a91 Merge pull request #23190 from AkihiroSuda/addendum23141
Fix the comment for daemon/logger.Copier
Upstream-commit: 69545fe19d294d5ff4c43c2adc2795935f14ae61
Component: engine
2016-06-02 12:21:52 +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