DOCKER Course

CMD

Go back

Run a command when the image is started. You may only have one per container. The syntax is

CMD command
# or
CMD "command1;command2;..."
# or
CMD ["command","arg1","arg2"]

With command, a command in the image's language. You could use it to start a program etc.


Example

# run my_prog when image is started
CMD ["./bin/my_prog"]