Last active
August 29, 2015 14:22
-
-
Save jacobat/316cff55350ec41cc811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@consul-slave-0:/vagrant/tmp$ cat Dockerfile | |
FROM ubuntu:14.04 | |
RUN mkdir /mount | |
RUN echo foo >> /mount/foobar | |
VOLUME /mount | |
vagrant@consul-slave-0:/vagrant/tmp$ docker build -t test . | |
Sending build context to Docker daemon 2.048 kB | |
Sending build context to Docker daemon | |
Step 0 : FROM ubuntu:14.04 | |
---> 07f8e8c5e660 | |
Step 1 : RUN mkdir /mount | |
---> Using cache | |
---> 70fcfc287788 | |
Step 2 : RUN echo foo >> /mount/foobar | |
---> Using cache | |
---> acde485325f8 | |
Step 3 : VOLUME /mount | |
---> Using cache | |
---> 2f9fd9dd3b6c | |
Successfully built 2f9fd9dd3b6c | |
vagrant@consul-slave-0:/vagrant/tmp$ docker run -v /tmp/foo:/mount test true | |
vagrant@consul-slave-0:/vagrant/tmp$ ls /tmp/foo/ | |
vagrant@consul-slave-0:/vagrant/tmp$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@consul-slave-0:/vagrant/tmp$ docker run --name myvol test true | |
vagrant@consul-slave-0:/vagrant/tmp$ docker run --volumes-from myvol ubuntu:14.04 cat /mount/foobar | |
foo | |
vagrant@consul-slave-0:/vagrant/tmp$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment