ENTRYPOINT

The Dockerfile instruction that sets the program a container always runs, with CMD supplying its default arguments.

In more detail

Arguments given to docker run replace only the CMD part, while the --entrypoint option overrides the program itself. A fixed entrypoint means users can run the image without remembering a special command. Write it in exec form, a list such as ["python", "app.py"], so signals reach the program.

Examples

ENTRYPOINT ["/app/app.sh"]
ENTRYPOINT ["python", "app.py"]
CMD ["--port", "8000"]
ENTRYPOINT ["/app"]
ENTRYPOINT ["java","-jar","app.jar"]

Related terms

Taught in

References

Certification courses