Dockerfile
Dockerfile
- dockerfile manuals:
- https://takacsmark.com/dockerfile-tutorial-by-example-dockerfile-best-practices-2018/
key instructions
-
CMD- what command should be run in the image
-
CMD [“executable”, “param1”, “param2”, ...] - Its possible to override the command on starting up a container
docker run myImage:latest _command_ - Only last
CMDwill be used (so specifiy only one). - Its a good practice to specify at leaset a shell command here.
-
ENTRYPOINT- Used to specify the 'main executable' of the image
- If
ENTRYPOINTis specified,CMDparamas will be added to theENTRYPOINT -
ENTRYPOINT ["git"] CMD ["--help"]
build dockerfile
docker build -t getting-started .