Skip to content

Instantly share code, notes, and snippets.

@cezarsa
Created January 7, 2015 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cezarsa/ec50989d3a1da70092b5 to your computer and use it in GitHub Desktop.
Save cezarsa/ec50989d3a1da70092b5 to your computer and use it in GitHub Desktop.
#!/bin/bash
id=$(docker run -d ubuntu:14.04 bash -c "mkdir -p /x && touch /x/a")
docker wait $id
sleep 1
docker commit $id myimg
docker run myimg ls -l /x --time-style=full-iso
id=$(docker run -d myimg bash -c "rm -rf /x && mkdir /x && touch /x/a")
docker wait $id
sleep 1
docker commit $id myimg2
docker run myimg2 ls -l /x --time-style=full-iso
id=$(docker run -d myimg2 bash -c "rm -rf /x && mkdir /x")
docker wait $id
sleep 1
docker commit $id myimg3
docker run myimg3 ls -l /x --time-style=full-iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment