Article Image
docker run --rm -t -i phusion/baseimage:0.9.11 /bin/bash  
  1. I use the baseimage-docker distro from phusion…its quite nice…includes bash, runit, and a few other nice features that make it feel like a full featured install that will work properly with docker (i.e. docker stop works correctly)

  2. The “–rm” will remove the container after you leave it. This is generally preferred.

  3. We just launch bash in this example. You could make your own image and launch it with zsh or the like:)

Now lets say you made some changes or installed some stuff and want to save the container for later…docker export should be able to help you:

docker export <containerid> > working.tar  

And of course, don’t forget to gzip it (these actually gzip fairly well):

gzip --best working.tar  

You can later import it like so:

cat working.tar > sudo docker import - working-image:lastest  

Note the difference between a save and export (no history of layers with export)

Blog Logo

Mario Loria




Because gets old after a while.

Back to Overview