Docker Community Forums

Share and learn in the Docker community.

How to mount volume created during build?

build

(Saul Shanabrook) #1

Is it possible to mount a volume during docker build, with the VOLUME dockerfile command?

I am using Docker for Mac and want to be able to mount that volume on my host system, so that I can access those files on my host files system.


(Think) #2

ADD / COPY within the Dockerfile also could access your host system. They access the place where you invoked the docker build command.
@saulshanabrook: Isn’t that sufficient for your usecase?


(Saul Shanabrook) #3

I am using this workflow to mount my source code after a npm install. I then want to extend it and mount the node_modules that were installed in the docker image, back in my host system, so that my intellisense editor can pick up the installed files.