Created
July 10, 2015 18:45
-
-
Save visualjeff/634f2fa0fa957cae34f1 to your computer and use it in GitHub Desktop.
Docker data container and how to move data from the host into the running container.
This file contains hidden or 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
To copy files from host into the container's data directory (depending on your environment you may need to prefix with sudo): | |
cp tnc_file.txt /var/lib/docker/aufs/mnt/$(docker inspect -f '{{.Id}}' tnc_data_container)/data |
This file contains hidden or 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
# To build: docker build --force-rm=true -t costco/data:0.0.1 . | |
# To run: docker run -d --name tnc_data_container -t costco/data:0.0.1 | |
FROM busybox:latest | |
MAINTAINER Jeffrey Gilbert <[email protected]> | |
RUN mkdir /data | |
VOLUME /data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment