Skip to content

Instantly share code, notes, and snippets.

@davidwalter0
Created September 18, 2014 19:30
Show Gist options
  • Save davidwalter0/de5d8244923c26b82067 to your computer and use it in GitHub Desktop.
Save davidwalter0/de5d8244923c26b82067 to your computer and use it in GitHub Desktop.
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment