Dockerfile development process


As a new to docker I want to understand the process of Dockerfile development. For my newbie point of view it tedious to update a line in the Dockerfile then build, run and test and if something doesn’t work, delete the container and image. And finally update the Dockerfile and repeat the process.

How do you develop your dockerfile? E.g. you might create a VM and try all installations and steps and put them into the Dockerfile, right?


I do not do it like this, but you could

  • docker run -ti ubuntu:14.04 # or what ever base image you image
  • apt-get update && apt-get install -y foo bar baz # install whatever you need and copy your application
  • …repeat the previous until it is working
  • then commit your container with docker commit
  • docker history contains every command you run to get it working…copy them to a Dockerfile
  • minimize the amount of command until you are satisfied with the result