Skip to content

Instantly share code, notes, and snippets.

# create an empty container for data -- mounted by docker into the /var/lib/docker* path
docker run --name=data-01--interactive --tty --volume=/data null /not.runnable.data.only.container
# use the empty data container
docker run --name=shell-with-data-01 --volumes-from=data-01 --interactive --tty centos:centos6 /bin/bash
# Multiple containers can use this for common storage.
docker run --name=shell-with-data-02 --volumes-from=data-01 --interactive --tty centos:centos6 /bin/bash
#!/bin/bash
# same idea as [https://docs.docker.com/articles/baseimages] different name than scratch
tar cv --files-from /dev/null | docker import - null