Hi,
I am learning Docker,
I have successfully created the build file,
Here is the scenario, I have copied few files to media
folder which is in /app/
while building the image, and I need to access this media
folder outside the docker also. So, I used the volumes.
So, while building the image, the structure of the files inside the docker looks like this
---/app
---media
---a.png
---c.png
I have the media
folder in the host system also, there I have some other files which requires for the app when starting the containers, I will change those specific files, every time I run the container.
The media
folder in the host system contains this files
---media
---b.png
---d.png
When I start the container, I use this command to create the volume -
sudo docker run -it --name test1 /home/qwerty/media:/app/media test1:v1
What is happened after running this command is, the files which are in the media folder inside the docker gets deleted [a.png and c.png] and, the files which are saved in the host system gets saved inside the docker.
I am looking for syncing of all the files[a.png, b.png, c.png, d.png] inside the docker instead of deletion of [a.png and c.png]. How to achieve this ?
I do not have the option to put those files in separate folders, to avoid this conflict
Thanks