Difference between docker cmd and docker entrypoint instructions and RUN COPY and ADD
Docker cmd helps define the default command and or parameters. The parameters of a CMD instruction can be over-ridden. If a dockerfile has several CMD only the last will be run. Docker entrypoint helps to define the container as an executable.
RUN is an instruction that runs at the build time of the container.
CMD runs when the container is starting
COPY command copies files from local directory to a directory in the container
ADD apart from the COPY functionality also allows to copy from URL or untars a tar file from source into the destination in the container
Shell Form -> Instruction <command>
Exec form -> Instruction ["executable", "param1", "param2"]
Comments
Post a Comment