CodePudding user response:
When Dockerfile defined Volume, then the docker run docker run - v & lt; Host_dir & gt; : & lt; Volume_dir & gt;For example,
1) VOLUME ["/var/lib/mysql "]
2) the docker run - d - v/mysql/data:/var/lib/mysql
CodePudding user response:
Run the docker run -- help command to see documentation- v - volume=[] Bind mount a volume
-v parameter is mounted, you said container run after any change made to it can't be saved, are read-only, so you like mount has no meaning, you want to view the running state of container? Can mount a directory such as/etc/system/etc directory in to the container, so should be ok,
CodePudding user response:
Lz, to share, to support youCodePudding user response:
Hello, the building Lord, is you solved this problem? Has also had the same problem now I don't know how to solve,CodePudding user response:
Direct access to the docker inspect - f {{. GraphDriver. Data. MergedDir}} ${containerid} can point to the directory, this is the file system, run time containerFor example:
CD $(docker inspect - f {{. GraphDriver. Data. MergedDir}} test01)
If you want to put the container of a directory under the map to a custom directory, the host machine can be used to mount -- bind, of course, ln -s,