| Network | Description |
|---|---|
| none | No networking in the container. |
| bridge (default) | Connect the container to the bridge via veth interfaces. |
| host | Use the host's network stack inside the container. |
| container:<name|id> | Use the network stack of another container, specified via its *name* or *id*. |
| NETWORK | Connects the container to a user created network (using `docker network create` command) |
| Policy | Result |
|---|---|
| no | Do not automatically restart the container when it exits. This is the default. |
| on-failure[:max-retries] | Restart only if the container exits with a non-zero exit status. Optionally, limit the number of restart retries the Docker daemon attempts. |
| always | Always restart the container regardless of the exit status. When you specify always, the Docker daemon will try to restart the container indefinitely. The container will also always start on daemon startup, regardless of the current state of the container. |
| unless-stopped | Always restart the container regardless of the exit status, but do not start it on daemon startup if the container has been put to a stopped state before. |
| Option | Result |
|---|---|
| memory=inf, memory-swap=inf (default) | There is no memory limit for the container. The container can use as much memory as needed. |
| memory=L<inf, memory-swap=inf |
(specify memory and set memory-swap as -1) The container is
not allowed to use more than L bytes of memory, but can use as much swap
as is needed (if the host supports swap memory).
|
| memory=L<inf, memory-swap=2*L | (specify memory without memory-swap) The container is not allowed to use more than L bytes of memory, swap *plus* memory usage is double of that. |
| memory=L<inf, memory-swap=S<inf, L<=S | (specify both memory and memory-swap) The container is not allowed to use more than L bytes of memory, swap *plus* memory usage is limited by S. |
| Option | Result |
|---|---|
| U != 0, K = inf (default) | This is the standard memory limitation mechanism already present before using kernel memory. Kernel memory is completely ignored. |
| U != 0, K < U | Kernel memory is a subset of the user memory. This setup is useful in deployments where the total amount of memory per-cgroup is overcommitted. Overcommitting kernel memory limits is definitely not recommended, since the box can still run out of non-reclaimable memory. In this case, you can configure K so that the sum of all groups is never greater than the total memory. Then, freely set U at the expense of the system's service quality. |
| U != 0, K > U | Since kernel memory charges are also fed to the user counter and reclamation is triggered for the container for both kinds of memory. This configuration gives the admin a unified view of memory. It is also useful for people who just want to track kernel memory usage. |
| Variable | Value |
|---|---|
HOME |
Set based on the value of USER
|
HOSTNAME |
The hostname associated with the container |
PATH |
Includes popular directories, such as :/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
TERM |
xterm if the container is allocated a pseudo-TTY |