This is a casual Docker tutorial series. We started out first with very simple sessions on how to install and use the docker run command. In future videos we will hit more advanced topics.
In this sixth video we cover the basics of a Dockerfile. We cover basic commands such as FROM, RUN and CMD along with other basic Dockerfile commands. Basically the tutorial describes the Dockerfile DSL.
I received some great feedback from Tibor Vass. I want to add some of his comments here and I will cover them in a little more detail on Part 2 of this tutorial. Here goes…
In general you want to use the JSON/Array format for the CMD and the ENTRYPOINT commands. If you use the non JSON the child processes might not get signaled. Therefore it is best practice to use the JSON format for those commands. Also, ENVAR substitution (i.e., environment variable) substitution only happens with the non JSON format. Therefore it might be a good practice to use non JSON on the RUN command.
It is encouraged to use the COPY command instead of the RUN command when untarring or downloading is not needed.
Learn More about Docker
- New to Docker? Try our 10 min online tutorial
- Share images, automate builds, and more with a free Docker Hub account
- Read the Docker 1.6 Release Notes
- Subscribe to Docker Weekly
- Attend upcoming Docker Meetups
- Attend upcoming Docker Online Meetups
- Register for DockerCon 2015
- Start contributing to Docker