Dockerfile
Last updated
Last updated
Check out for bases
A Docker image consists of read-only layers each of which represents a Dockerfile instruction
Use env variables you declare with env like $foo
RUN has 2 forms:
RUN <command>
(shell form, the command is run in a shell, which by default is /bin/sh -c
on Linux or cmd /S /C
on Windows)
RUN ["executable", "param1", "param2"]
(exec form)
The CMD
instruction has three forms:
CMD ["executable","param1","param2"]
(exec form, this is the preferred form)
CMD ["param1","param2"]
(as default parameters to ENTRYPOINT)
CMD command param1 param2
(shell form)
There can only be one CMD
instruction in a Dockerfile
. If you list more than one CMD
then only the last CMD
will take effec
Like ADD, but without urls and tar handling, should be used when you dont need ADD
Add things to .dockerignore
file to prevent copying