Docker Community Forums

Share and learn in the Docker community.

How to use docker volume -v or -volume to change at run time


(Sarthak123) #1

To use docker volume -v or -volume to change at run time, I want to do the following things:

-Copy one container from other container
-If I have made build of static html code and if i have changed to html code then it will directly reflect to the build (don’t need to build again change will directly reflects at runtime)

Can anyone suggest me the solution or provide me reference links(if any) for the above question.

Thanks in advance.

(Sam) #2

sorry, not quite sure what you are asking…

how to use a volume to support the code for your website during runtime (live changes)

if you use -v then that volume is just like a folder inside your container, you don’t need to copy at all.
make a change and the next time that html file is loaded, that is what will be displayed.
no build required…

in my use I do

docker run -d -v host_folder:/var/www/html

and /var/www/html is the apache site rot folder