Commit Graph

135 Commits

Author SHA1 Message Date
31162a9a25 Dropped hyphen in bind mount where appropriate
Signed-off-by: Christophe Vidal <kriss@krizalys.com>
Upstream-commit: 037029414d
Component: cli
2017-08-19 21:14:48 +07:00
c16c5f3db8 Fix repo references in docs
Since CLI was moved to a separate repo, these references are incorrect.
Fixed with the help of sed script, verified manually.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 6d85a4f5f8
Component: cli
2017-07-28 10:32:42 -07:00
9e2f4854f6 Clarify that you can use -d and --rm together now
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: c63485b47d
Component: cli
2017-07-03 16:43:41 -07:00
9a66d3e2b0 Merge pull request #32804 from bbodenmiller/patch-1
remove extra word
(cherry picked from commit 9db03bd8cdad3c8804105cb5794ebad5e728f48f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3eaec0071c3ce1b7201e37859afe5bcb78d4f215)
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: ba4dcadcaa
Component: cli
2017-06-14 02:48:46 +00:00
a7a84c14b2 Improve documentation on the -e flag to the 'run' cli command. The ability to import the current vale of an environment variable by simply naming the variable didn't seem to be documented anywhere. (see opts/env.go)
Signed-off-by: John V. Martinez <jvmatl@gmail.com>
Upstream-commit: a316bc3895
Component: cli
2017-06-02 00:11:05 +00:00
61c68f6c04 fix confusing description of stdout/stdin pipe
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6a767c1711
Component: cli
2017-06-02 00:11:05 +00:00
429d548d41 Added start period option to health check.
Signed-off-by: Elias Faxö <elias.faxo@gmail.com>
Upstream-commit: c5071b94da
Component: cli
2017-06-02 00:11:02 +00:00
e1322682e0 docs: remove outdated reference to updating /etc/hosts
Starting with docker 1.10, docker no longer uses
/etc/hosts for service discovery, but uses an
embedded DNS server. This patch removes a reference
to the old (pre 1.10) behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: afe91a5120
Component: cli
2017-06-02 00:10:58 +00:00
400bf05854 Add daemon flag to set no_new_priv as default for unprivileged containers.
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
Upstream-commit: 218740abc7
Component: cli
2017-06-02 00:10:55 +00:00
fd7bb178af Remove --init-path mention
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
Upstream-commit: b380c2eb63
Component: cli
2017-06-02 00:10:53 +00:00
5a52b7e76e Document --init flag for docker run
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
Upstream-commit: f571b363e6
Component: cli
2017-06-02 00:10:53 +00:00
227539bc5c Update run.md ENV docs
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 8c24f5d5e7
Component: cli
2017-06-02 00:10:49 +00:00
16f46460cc update docs about --oom-score-adj
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 175d21838a
Component: cli
2017-06-02 00:10:45 +00:00
5f243da8df fix some broken contents links
Signed-off-by: Qinglan Peng <qinglanpeng@zju.edu.cn>

fix-contents-links

Signed-off-by: Qinglan Peng <qinglanpeng@zju.edu.cn>
Upstream-commit: 2d40fc55b8
Component: cli
2017-06-02 00:10:44 +00:00
9bc2b4dd44 Fix some format errors
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Upstream-commit: e248501799
Component: cli
2017-06-02 00:10:42 +00:00
fe9a20e2a3 Fix a description of 'docker run [-a]'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Upstream-commit: 43a8f3b028
Component: cli
2017-06-02 00:10:41 +00:00
29bd09e6d2 Revert reference docs for ambient capabilities
This feature was reverted for docker 1.13
in c5251f7116e3d9095a7169fc31bd170dff997c2e,
so removing the documentation as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f2573a87ed
Component: cli
2017-06-02 00:10:39 +00:00
890a070951 Add --dns-option to docker run and hide --dns-opt
This fix is a follow up to #27567 based on:
https://github.com/docker/docker/pull/27567#issuecomment-259295055

In #27567, `--dns-options` has been added to `service create/update`,
together with `--dns` and `--dns-search`. The `--dns-opt` was used
in `docker run`.

This fix add `--dns-option` (not `--dns-options`) to `docker run/create`, and hide
`--dns-opt`. It is still possible to use `--dns-opt` with
`docker run/create`, though it will not show up in help output.

This fix change `--dns-options`to --dns-option` for `docker service create`
and `docker service update`.

This fix also updates the docs and bash/zsh completion scripts.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ebacbb50ae
Component: cli
2017-06-02 00:10:36 +00:00
b1abdb7217 Add --cpus flag to control cpu resources
This fix tries to address the proposal raised in 27921 and add
`--cpus` flag for `docker run/create`.

Basically, `--cpus` will allow user to specify a number (possibly partial)
about how many CPUs the container will use. For example, on a 2-CPU system
`--cpus 1.5` means the container will take 75% (1.5/2) of the CPU share.

This fix adds a `NanoCPUs` field to `HostConfig` since swarmkit alreay
have a concept of NanoCPUs for tasks. The `--cpus` flag will translate
the number into reused `NanoCPUs` to be consistent.

This fix adds integration tests to cover the changes.

Related docs (`docker run` and Remote APIs) have been updated.

This fix fixes 27921.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d93d09acaa
Component: cli
2017-06-02 00:10:32 +00:00
35146fe359 fix frontmatter keywords value type (string, instead of []string) in /docs/reference
Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
Upstream-commit: 572c6bb89a
Component: cli
2017-06-02 00:10:31 +00:00
08be90cdc7 fill all the rest invalid address because no related directory
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 9b109cd9a7
Component: cli
2017-06-02 00:10:30 +00:00
94054df6ff fill the complete address because of no userguide directory
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 2603a9c1dd
Component: cli
2017-06-02 00:10:30 +00:00
5ef6f17a9d Implementing support for --cpu-rt-period and --cpu-rt-runtime so that
containers may specify these cgroup values at runtime. This will allow
processes to change their priority to real-time within the container
when CONFIG_RT_GROUP_SCHED is enabled in the kernel. See #22380.

Also added sanity checks for the new --cpu-rt-runtime and --cpu-rt-period
flags to ensure that that the kernel supports these features and that
runtime is not greater than period.

Daemon will support a --cpu-rt-runtime flag to initialize the parent
cgroup on startup, this prevents the administrator from alotting runtime
to docker after each restart.

There are additional checks that could be added but maybe too far? Check
parent cgroups to ensure values are <= parent, inspecting rtprio ulimit
and issuing a warning.

Signed-off-by: Erik St. Martin <alakriti@gmail.com>
Upstream-commit: 42ef78911e
Component: cli
2017-06-02 00:10:28 +00:00
a6e7161261 Typo --ti and missing my_strace_docker_image
Signed-off-by: Leo Gallucci <leo.gallucci@zalando.de>
Upstream-commit: 74e0f7857b
Component: cli
2017-06-02 00:10:28 +00:00
118bce70c4 Sync docker/docker refs with files mistakenly edited in docker.github.io repo
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 7f36c3a1a0
Component: cli
2017-06-02 00:10:26 +00:00
fbc93c2df5 Convert Markdown frontmatter to YAML
Some frontmatter such as the weights, menu stuff, etc is no longer used
'draft=true' becomes 'published: false'

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 2845676cc2
Component: cli
2017-06-02 00:10:24 +00:00
9916ceda76 Add support for ambient capabilities
Linux kernel 4.3 and later supports "ambient capabilities" which are the
only way to pass capabilities to containers running as a non root uid.

Previously there was no way to allow containers not running as root
capabilities in a useful way.

Fix #8460

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 856a50e733
Component: cli
2017-06-02 00:10:13 +00:00
3fc85d0d86 Remove extra paren in run --link docs
Signed-off-by: Josh Bodah <jb3689@yahoo.com>
Upstream-commit: 622f3bf19f
Component: cli
2017-06-02 00:10:10 +00:00
2e5d081e78 clean up the run.md in reference
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 2ff594515f
Component: cli
2017-06-02 00:10:07 +00:00
4271b8612c Fixes #25918 - Changed --permissive to --privileged.
Signed-off-by: Rich Moyse <rich@moyse.us>
Upstream-commit: 463d68bde9
Component: cli
2017-06-02 00:10:07 +00:00
a722d87773 Split list of capabilities into those added by default and those not
The documentation was a bit unhelpful as to what are the default
capabilities, so split.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: ff474eb300
Component: cli
2017-06-02 00:10:05 +00:00
d17acd563f Update documentation for entrypoint unset with docker run/create
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 68ea0dc2d0
Component: cli
2017-06-02 00:10:04 +00:00
4fc52bf5bf Add note about --entrypoint overriding default command
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Upstream-commit: 897dc90656
Component: cli
2017-06-02 00:10:02 +00:00
c05d80f923 Document --oom-score-adj flag in docker run
This was only mentioned in docker create documentation.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 6a983cc502
Component: cli
2017-06-02 00:07:51 +00:00
12ad3a866c Expand the documentation of "no-new-privileges"
The change to runc in https://github.com/opencontainers/runc/pull/789
was not documented previously. Also say what this affects and clean
up layout of initial table as there was some miscolouration of the
continuation lines.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 8bc84934fb
Component: cli
2017-06-02 00:07:50 +00:00
d1c6ce2e15 Rename --net to --network
Add a `--network` flag which replaces `--net` without deprecating it
yet. The `--net` flag remains hidden and supported.

Add a `--network-alias` flag which replaces `--net-alias` without deprecating
it yet. The `--net-alias` flag remains hidden and supported.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Upstream-commit: 253a5f4ea2
Component: cli
2017-06-02 00:07:50 +00:00
6e77acb1af Allow user to specify container's link-local addresses
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 987e5e6d8a
Component: cli
2017-06-02 00:07:44 +00:00
e1cb76e0ab surfacing Learn by example topics to top level of Docker Engine docs
fixing links after moving surfacing tutorials

fixing more links for the newly located tutorials

Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
Upstream-commit: d3b7a2779e
Component: cli
2017-06-02 00:07:43 +00:00
abc876a868 Added example for using image digest in the docker run command
Signed-off-by: Shoubhik Bose <sbose78@gmail.com>

Added explanation for the example with image's digest ( as per @thaJeztah 's comment

Signed-off-by: Shoubhik Bose <sbose78@gmail.com>

Wrapped to ~80 chars

Signed-off-by: Shoubhik Bose <sbose78@gmail.com>
Upstream-commit: 0a0bb19a33
Component: cli
2017-06-02 00:07:43 +00:00
4231660e73 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: 51ddea93a2
Component: cli
2017-06-02 00:07:41 +00:00
711901f473 The option --add-host and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--add-host` and `--net=host` to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d1aaf129f2
Component: cli
2017-06-02 00:07:40 +00:00
41d05e62cc The option --dns, --dns-search, --dns-opt and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--dns`, `--dns-search`, `--dns-opt` and `--net=host`
to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: f17fb53f53
Component: cli
2017-06-02 00:07:40 +00:00
1571188650 remove duplicated text
Signed-off-by: Michael Friis <friism@gmail.com>
Upstream-commit: 3cc96bb891
Component: cli
2017-06-02 00:07:39 +00:00
db8fde32b9 Remove MLS example from SELinux example in run reference
Automatic translation of MLS labels is currently not
supported, so should not be documented as an example.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 563b5dab54
Component: cli
2017-06-02 00:07:39 +00:00
8cac76883e Align default seccomp profile with selected capabilities
Currently the default seccomp profile is fixed. This changes it
so that it varies depending on the Linux capabilities selected with
the --cap-add and --cap-drop options. Without this, if a user adds
privileges, eg to allow ptrace with --cap-add sys_ptrace then still
cannot actually use ptrace as it is still blocked by seccomp, so
they will probably disable seccomp or use --privileged. With this
change the syscalls that are needed for the capability are also
allowed by the seccomp profile based on the selected capabilities.

While this patch makes it easier to do things with for example
cap_sys_admin enabled, as it will now allow creating new namespaces
and use of mount, it still allows less than --cap-add cap_sys_admin
--security-opt seccomp:unconfined would have previously. It is not
recommended that users run containers with cap_sys_admin as this does
give full access to the host machine.

It also cleans up some architecture specific system calls to be
only selected when needed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: ba8f5cfbb8
Component: cli
2017-06-02 00:07:39 +00:00
53b32800ef Add support for --pid=container:<id>
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: 637048e176
Component: cli
2017-06-02 00:07:39 +00:00
6777871c09 from inheritted to inherited
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: d16947629c
Component: cli
2017-06-02 00:07:37 +00:00
96321e2038 Remove unnecessary double-double quotes
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: fe09131526
Component: cli
2017-06-02 00:07:37 +00:00
ef2cb7e662 remove "the" in docs.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: 7d3bb7a6d0
Component: cli
2017-06-02 00:07:37 +00:00
a1deb91f73 update cgroup link in doc of run
Signed-off-by: Hao Zhang <21521210@zju.edu.cn>
Upstream-commit: 64ba15e3a3
Component: cli
2017-06-02 00:07:37 +00:00