0

I am trying to add a directory in the container I just created but can't following steps I have taken.

docker images
isbhatt/prefixman   v1                  cbeed3545d24        About an hour ago   1.044 GB

Then

docker run -v /media/sf_MY_WINDOWS/GitRepo/SDS/SDSNG/:/tmp/SDSNG --name "prefixman_v1" isbhatt/prefixman:v1

Then committing into that container

docker commit -m "prefixman_v1" 35fb30be015c

which gave me an id and I tagged the image on it by

docker tag b9873e80b6d0d68bf605b1ead34ba08f2c044b6cea03f7f57553a97f89845fbe prefixman_v1

Then I started container on fresh image by running

docker run -it prefixman_v1 /bin/bash

So, what I can see is that I can see SDSNG directory in /tmp in container but that directory is empty. Where am I going wrong??

Ishan Bhatt
  • 9,287
  • 6
  • 23
  • 44
  • 3
    You can't save a host->volume mapping. If you want to expose a host directory you need to provide the `-v host_path:container_path` to `docker run` every time. – larsks Aug 24 '15 at 14:41

1 Answers1

0

To elaborate on what larsks said, you should read my answer to Can Docker containers (NOT Docker images) be moved?

A docker container is a process, isolated, with a network card, and by default, 10 GB of disk space. This 10 GB should be quite enough for some code and some config files. If you need to deal with data, docker offers volumes. A must-read is

https://docs.docker.com/userguide/dockervolumes/

or

http://container-solutions.com/understanding-volumes-docker/

Community
  • 1
  • 1
user2915097
  • 30,758
  • 6
  • 57
  • 59