mirror of https://github.com/docker/cli.git
Fix CMD --ignored-param1 example
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
(cherry picked from commit 119c7fb84d
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2e82d11def
commit
c3d4d623c8
|
@ -1632,7 +1632,7 @@ If you forget to add `exec` to the beginning of your `ENTRYPOINT`:
|
||||||
```dockerfile
|
```dockerfile
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
ENTRYPOINT top -b
|
ENTRYPOINT top -b
|
||||||
CMD --ignored-param1
|
CMD -- --ignored-param1
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then run it (giving it a name for the next step):
|
You can then run it (giving it a name for the next step):
|
||||||
|
@ -1640,12 +1640,15 @@ You can then run it (giving it a name for the next step):
|
||||||
```console
|
```console
|
||||||
$ docker run -it --name test top --ignored-param2
|
$ docker run -it --name test top --ignored-param2
|
||||||
|
|
||||||
Mem: 1704184K used, 352484K free, 0K shrd, 0K buff, 140621524238337K cached
|
top - 13:58:24 up 17 min, 0 users, load average: 0.00, 0.00, 0.00
|
||||||
CPU: 9% usr 2% sys 0% nic 88% idle 0% io 0% irq 0% sirq
|
Tasks: 2 total, 1 running, 1 sleeping, 0 stopped, 0 zombie
|
||||||
Load average: 0.01 0.02 0.05 2/101 7
|
%Cpu(s): 16.7 us, 33.3 sy, 0.0 ni, 50.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
|
||||||
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
|
MiB Mem : 1990.8 total, 1354.6 free, 231.4 used, 404.7 buff/cache
|
||||||
1 0 root S 3168 0% 0% /bin/sh -c top -b cmd cmd2
|
MiB Swap: 1024.0 total, 1024.0 free, 0.0 used. 1639.8 avail Mem
|
||||||
7 1 root R 3164 0% 0% top -b
|
|
||||||
|
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||||
|
1 root 20 0 2612 604 536 S 0.0 0.0 0:00.02 sh
|
||||||
|
6 root 20 0 5956 3188 2768 R 0.0 0.2 0:00.00 top
|
||||||
```
|
```
|
||||||
|
|
||||||
You can see from the output of `top` that the specified `ENTRYPOINT` is not `PID 1`.
|
You can see from the output of `top` that the specified `ENTRYPOINT` is not `PID 1`.
|
||||||
|
@ -1654,12 +1657,12 @@ If you then run `docker stop test`, the container will not exit cleanly - the
|
||||||
`stop` command will be forced to send a `SIGKILL` after the timeout:
|
`stop` command will be forced to send a `SIGKILL` after the timeout:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker exec -it test ps aux
|
$ docker exec -it test ps waux
|
||||||
|
|
||||||
PID USER COMMAND
|
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
|
||||||
1 root /bin/sh -c top -b cmd cmd2
|
root 1 0.4 0.0 2612 604 pts/0 Ss+ 13:58 0:00 /bin/sh -c top -b --ignored-param2
|
||||||
7 root top -b
|
root 6 0.0 0.1 5956 3188 pts/0 S+ 13:58 0:00 top -b
|
||||||
8 root ps aux
|
root 7 0.0 0.1 5884 2816 pts/1 Rs+ 13:58 0:00 ps waux
|
||||||
|
|
||||||
$ /usr/bin/time docker stop test
|
$ /usr/bin/time docker stop test
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue