Docker ENTRYPOINT and docker run --entrypoint
Answer: ENTRYPOINT sets the executable a container should run as. It has two possible forms: exec form (preferred) and shell form. docker run --entrypoint overwrites the default entrypoint set by the image.
Examples
FROM python:3.13-slim
ENTRYPOINT ["python"]
CMD ["app.py"]
docker run --entrypoint python myapp -c "print(1)"
Rules
- Command line arguments to
docker run <image>are appended after an exec-form ENTRYPOINT. - Those arguments override elements specified using CMD.
See also
Claims
- id: C1 claim: ENTRYPOINT configures a container to run as an executable. source: S1 evidence: "An ENTRYPOINT allows you to configure a container"
- id: C2 claim: ENTRYPOINT has an exec form and a shell form. source: S1 evidence: "ENTRYPOINT has two possible forms"
- id: C3 claim: --entrypoint overwrites the default entrypoint set by the image. source: S2 evidence: "Overwrite the default entrypoint set by the image"
Sources
- [S1] Dockerfile reference. Docker docs. https://docs.docker.com/reference/dockerfile/ . License: Apache-2.0. Accessed 2026-11-18.
- [S2] Running containers. Docker docs. https://docs.docker.com/engine/reference/run/ . License: Apache-2.0. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker docs, Dockerfile reference; Docker docs, Running containers. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker docs, Dockerfile reference; Docker docs, Running containers. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "Docker ENTRYPOINT and docker run --entrypoint." iinventedlight Library, iil:note:vfd6br5b, version of 2026-11-18. https://iinventedlight.com/library/notes/docker-entrypoint/. License: CC-BY-4.0.
@misc{iil_note_vfd6br5b,
author = {{iinventedlight}},
title = {{Docker ENTRYPOINT and docker run --entrypoint}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/docker-entrypoint/},
note = {Permanent ID iil:note:vfd6br5b. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-entrypoint.md.