Skip to content

Instantly share code, notes, and snippets.

@AmitAronovitch
Created November 26, 2016 21:09
Show Gist options
  • Save AmitAronovitch/b97f7c3a9586a463a2cedfe42b4aea1d to your computer and use it in GitHub Desktop.
Save AmitAronovitch/b97f7c3a9586a463a2cedfe42b4aea1d to your computer and use it in GitHub Desktop.
demo: docker containers preserve data
amit@penguin:~$ docker run -i -t debian /bin/bash
root@338b5a0ff034:/# mkdir /usr/local/blabla
root@338b5a0ff034:/# echo hello-there >/usr/local/blabla/data
root@338b5a0ff034:/# exit
exit
amit@penguin:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
338b5a0ff034 debian "/bin/bash" 32 seconds ago Exited (0) 5 seconds ago stoic_goldberg
13ffee81f8cd debian "/bin/bash" 35 hours ago Exited (0) 29 hours ago boring_kowalevski
amit@penguin:~$ docker start -a -i 338b5a0ff034
root@338b5a0ff034:/# cat /usr/local/blabla/data
hello-there
root@338b5a0ff034:/#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment