Skip to content

CMD vs ENTRYPOINT

Select an icon to see what it is.

Step 4 of 6

--entrypoint replaces the entrypoint

To change the executable itself you must use --entrypoint, which sets Entrypoint in the create request. Give the arguments after the image name, as in this example. This is how you run a shell or a tool inside an image whose entrypoint is an app.

$ docker run --rm --entrypoint cat cmddemo /etc/os-release

POST /v1.45/containers/create

{
"Image": "cmddemo"
"Entrypoint": [
"cat"
]
"Cmd": [
"/etc/os-release"
]
}