Skip to content

Instantly share code, notes, and snippets.

@visualjeff
Created July 10, 2015 18:45
Show Gist options
  • Save visualjeff/634f2fa0fa957cae34f1 to your computer and use it in GitHub Desktop.
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.
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
# 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 <jgilber@costco.com>
RUN mkdir /data
VOLUME /data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment