DELAPARRA
Index
Color
NL
Category: Docker

ENTRYPOINT

Explained by Updated

What is ENTRYPOINT?

ENTRYPOINT: The fixed executable a container always runs. Arguments from docker run (and CMD) are appended to it. ENTRYPOINT sets the fixed program a container always runs. Arguments from docker run, or from CMD, are added to it. With ENTRYPOINT ["php", "artisan"] and CMD ["serve"], the container runs php artisan serve by default, and docker run myapp migrate runs php artisan migrate.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about ENTRYPOINT

How is ENTRYPOINT used in practice?

This makes an image behave like a command-line tool with a sensible default action.

What should you keep in mind with ENTRYPOINT?

A common pattern is an entrypoint shell script that prepares things, such as waiting for the database or setting permissions, and ends with exec "$@" to run the actual command. The exec is important: it makes your application the main process, so it receives stop signals and shuts down cleanly. Use the JSON array form for both instructions to avoid an extra shell in between.

What does an example of ENTRYPOINT look like?

ENTRYPOINT ["python", "manage.py"] CMD ["runserver"]

At a glance

CategoryDocker
Explained by
Updated

More Docker terms

All terms starting with E

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.