Dockerfile
Dockerfile
is a text file where you define instructions used to create your Docker images, check official Dockerfile Reference documentation: https://docs.docker.com/engine/reference/builder/[1]
For creating this file with instructions usually called Dockerfile you can use the following keywords[2]:
ADD
ARG
- CMD, for executing containers. https://docs.docker.com/engine/reference/builder/#cmd
COPY
- ENTRYPOINT: https://docs.docker.com/engine/reference/builder/#entrypoint
ENV
EXPOSE
FROM
https://docs.docker.com/engine/reference/builder/#from- HEALTHCHECK https://docs.docker.com/engine/reference/builder/#healthcheck (>= Docker 1.12)
- LABEL
- ONBUILD
RUN:
https://docs.docker.com/engine/reference/builder/#run- SHELL
- STOPSIGNAL
USER
: https://docs.docker.com/engine/reference/builder/#user- VOLUME, creates a mount point
- WORKDIR
Activities
- Learn differences between RUN and CMD or ENTRYPOINT: https://stackoverflow.com/a/25150809
- Read Understand how CMD and ENTRYPOINT interact https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact
- Learn about start configuration behavior and restart policy
- Learn how to use
.dockerignore
file - Read
Dockerfile
best practices https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
Related terms
- Dockerfile examples
docker build
docker-compose build
- Docker Engine release notes
- BuildKit Dockerfile-agnostic builder toolkit
docker start
,docker run
- Buildpack
.dockerignore
Makefile
- docker-compose build
image:
See also
Dockerfile: FROM, RUN, CMD, ENTRYPOINT, WORKDIR, COPY, ADD, USER, ENV, ARG, HEALTHCHECK
,hadolint, LABEL, EXPOSE
docker build [ --tag | --platform | --help ] FROM, Dockerfile, .dockerignore, requirements.txt, docker build --help, docker tag
docker-compose
,docker-compose.yml
: [services
|volumes
|networks
|up
|down
|restart
|logs
|create
|changelog
|version
|secrets
|config
|-v
|-h
|exec], docker-compose pull
,Environment:
, Docker-compose.yml examples,.env
, release notes, expose:, docker-compose --env-file,services.deploy.resources
Advertising: