Commit Graph

109 Commits

Author SHA1 Message Date
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
b337b8e4b2 docs: add note about MAC addresses not being unique
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d192f97acc
Component: cli
2017-06-02 00:07:36 +00:00
30f948a78a Fix the old exit status example
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
Upstream-commit: 6a5870dcfa
Component: cli
2017-06-02 00:07:36 +00:00
f2eeb16b6e Fix deprecated format for security-opt
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
Upstream-commit: a8a29fe7f5
Component: cli
2017-06-02 00:07:35 +00:00
546f96b8fb Correct the description of --group-add in run.md
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 42dfcc1d2a
Component: cli
2017-06-02 00:07:35 +00:00
80aebaf272 Un-deprecate auto-creation of host directories for mounts
Auto-creation of host-directories was marked deprecated in
Docker 1.9, but was decided to be too much of an backward-incompatible
change, so it was decided to keep the feature.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0a13b2a1ce
Component: cli
2017-06-02 00:07:35 +00:00
c5e162c9a0 Add explicit flags for volume cp/no-cp
This allows a user to specify explicitly to enable
automatic copying of data from the container path to the volume path.
This does not change the default behavior of automatically copying, but
does allow a user to disable it at runtime.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: eba678647b
Component: cli
2017-06-02 00:07:32 +00:00
4728023c9a Consolidate security options to use = as separator.
All other options we have use `=` as separator, labels,
log configurations, graph configurations and so on.
We should be consistent and use `=` for the security
options too.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: a7364b3743
Component: cli
2017-06-02 00:07:32 +00:00
54da3984d3 Fix documentation on --security-opt seccomp
Missing documentation and man pages on seccomp options.
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 2d0316cb43
Component: cli
2017-06-02 00:07:32 +00:00
a81a386a03 Fix typo
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: d219111855
Component: cli
2017-06-02 00:07:32 +00:00
3f4a780a92 Allow --hostname with --net=host
Docker creates a UTS namespace by default, even with --net=host, so it
is reasonable to let the user set the hostname. Note that --hostname is
forbidden if the user specifies --uts=host.

Closes #12076
Signed-off-by: Jason Heiss <jheiss@aput.net>
Upstream-commit: 6bcb137d2f
Component: cli
2017-06-02 00:07:32 +00:00
b21975d5e4 Add support for NoNewPrivileges in docker
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Add tests for no-new-privileges

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Update documentation for no-new-privileges

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: d3f632156e
Component: cli
2017-06-02 00:07:31 +00:00
c2ad27ed2c update cap-add docs for seccomp
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 91d0d25ee4
Component: cli
2017-06-02 00:07:28 +00:00
6fd29bd537 Improve usage details on overriding USER command in Docker run reference page
Signed-off-by: Sian Lerk Lau <kiawin@gmail.com>
Upstream-commit: 7c85fb1665
Component: cli
2017-06-02 00:07:28 +00:00
23eff15228 Remove "--group-add dbus" from busybox example (no dbus group in busybox anymore)
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: a015293ff7
Component: cli
2017-06-02 00:07:28 +00:00
cce394556a Fix docs for tmpfs (pr 19688)
Underlying files are no longer copied to the tmpfs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d4fd7fd13b
Component: cli
2017-06-02 00:07:27 +00:00
b82ff962b6 Creating Engine specific menu
Fixing the links
Updating with Seb's comments
Adding weight
Fixing the engine aliases
Updating after Arun pushed
Removing empty file

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: 7910f01804
Component: cli
2017-06-02 00:07:26 +00:00
22f6c54f1d Add note about mount propagation on systemd
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 88fa05ccb4
Component: cli
2017-06-02 00:07:26 +00:00
ee198d09c4 On container rm, don't remove named mountpoints
This makes it so when calling `docker run --rm`, or `docker rm -v`, only
volumes specified without a name, e.g. `docker run -v /foo` instead of
`docker run -v awesome:/foo` are removed.

Note that all volumes are named, some are named by the user, some get a
generated name. This is specifically about how the volume was specified
on `run`, assuming that if the user specified it with a name they expect
it to persist after the container is cleaned up.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 8de6a3fc71
Component: cli
2017-06-02 00:07:26 +00:00
e1b3e37e5c Correcting overlay -> bridge driver in run.md
Correcting `overlay` -> `bridge` driver in run.md to match the preceding paragraph.

Signed-off-by: Jasmine Hegman <jasmine@jhegman.com>
Upstream-commit: 6495ac0c5f
Component: cli
2017-06-02 00:07:25 +00:00
732a628e72 Network scoped alias support
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 46db31de0a
Component: cli
2017-06-02 00:07:24 +00:00
0570aaed74 Add missing documentation for static IP options
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: d3aa590eec
Component: cli
2017-06-02 00:07:23 +00:00
26855c6072 Docs update for link functionality in user-defined networks
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: bf03439e68
Component: cli
2017-06-02 00:07:23 +00:00
6778fba09c Allow user to choose the IP address for the container
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 0a3c040a07
Component: cli
2017-06-02 00:07:22 +00:00
a8ec34a0cc Fix pid=host example in documentation
The existing example didn't illustrate how to
install strace in the container. In addition,
the rhel7 image used is no longer public (and maintained)
so not a good image to use in the example.

This updates the example to use htop (strace is
not working without disabling apparmor for the container)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 31ad32c879
Component: cli
2017-06-02 00:07:22 +00:00
001436e214 remove =false from options that default to false in the docs
This re-aligns the docs with what the cmd line now does.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 421578fbd4
Component: cli
2017-06-02 00:07:21 +00:00
7b918f92d1 Add support for blkio read/write iops device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 499d634f32
Component: cli
2017-06-02 00:07:21 +00:00