2

I have an application running as a docker container on a host. What I want is to have a location in the host filesystem accessible from the application. The reason I want a location outside the docker container is that the said location will contain a text file that would be updated by a piece of code running on some other host.

What location could be used for this purpose ?

white-hawk-73
  • 856
  • 2
  • 10
  • 24
  • The answer to this question might help: https://stackoverflow.com/questions/25311613/docker-mounting-volumes-on-host What it boils down to is that docker's "volumes" functionality is what you want to look into – romeara Mar 18 '17 at 15:44

1 Answers1

0

You need to add a volume during the run command using -v.

docker run -d -v <path-of-volume-in-host> <path-to-mount-in-container> ubuntu

You may refer this for more information.

Neeraj
  • 1,769
  • 3
  • 24
  • 41