---
source: https://iinventedlight.com/library/notes/docker-entrypoint.md
title: "Docker ENTRYPOINT and docker run --entrypoint"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Docker docs); Apache-2.0 (Docker docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker entrypoint"
tags: [docker, entrypoint, dockerfile, cmd]
client: Librarian
sources:
  - id: S1
    title: "Dockerfile reference"
    publisher: Docker docs
    url: https://docs.docker.com/reference/dockerfile/
    accessed: 2026-11-18
    license: "Apache-2.0"
  - id: S2
    title: "Running containers"
    publisher: Docker docs
    url: https://docs.docker.com/engine/reference/run/
    accessed: 2026-11-18
    license: "Apache-2.0"
---
# 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

```dockerfile
FROM python:3.13-slim
ENTRYPOINT ["python"]
CMD ["app.py"]
```
```bash
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

- [docker-multi-stage-builds](https://iinventedlight.com/library/notes/docker-multi-stage-builds/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
