Friday, June 28, 2019

[DOCKER] Sharing data between host and container

Reference

https://hackernoon.com/docker-data-containers-cb250048d162


Trial 1


  • First approach was to use the "-v" when running a container to mount a folder on the container.
  • This did not work due to "Firewall" issues



Trial 2

The idea is to create a container which stores the data that needs to be shared with the container


  • Create a data container

docker create -v /shared_data --name dataContainer busybox


  • Copy data to the container
docker cp test.csv dataContainer:/shared_data/



  • Run the intended container with the argument --volumes-from pointing at the name of the data container


docker run --rm --volumes-from dataContainer -p 8787:8787 mabolfadl/rstudio_libs:v1



No comments:

Post a Comment

Loud fan of desktop

 Upon restart the fan of the desktop got loud again. I cleaned the desktop from the dust but it was still loud (Lower than the first sound) ...