Ask questionsnotes for "Shell form ENTRYPOINT example" need to be cleaned up
File: engine/reference/builder.md
These points relate to https://docs.docker.com/engine/reference/builder/#shell-form-entrypoint-example. Several points:
FROM ubuntu
ENTRYPOINT top -b
CMD --ignored-param1
# docker build -t top .
Sending build context to Docker daemon 70.14kB
Error response from daemon: Dockerfile parse error line 6: Unknown flag: ignored-param1
#
docker run in the example given:$ docker run -it --name test top --ignored-param2
Mem: 1704184K used, 352484K free, 0K shrd, 0K buff, 140621524238337K cached
CPU: 9% usr 2% sys 0% nic 88% idle 0% io 0% irq 0% sirq
Load average: 0.01 0.02 0.05 2/101 7
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
1 0 root S 3168 0% 0% /bin/sh -c top -b cmd cmd2
7 1 root R 3164 0% 0% top -b
Command gives --ignored-param2, while output uses cmd cmd2. This is besides the fact that the container's output from top does not reveal the command line arguments for both sh and top; you need to use docker top test for that.
ENTRYPOINT exec_entry p1_entry, with CMD exec_cmd p1_cmd entry. I get /bin/sh -c exec_entry p1_entry sh -c exec_cmd p1_cmd
Answer
questions
jf
# docker version
Client: Docker Engine - Community
Version: 19.03.12
API version: 1.40
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:45:44 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.12
API version: 1.40 (minimum version 1.12)
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:44:15 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
Related questions