Mode 1 : Modify configuration file ( Need to stop docker service )
1, stop it docker service
systemctl stop docker.service( crux , Must stop before modifying docker service )
2,vim /var/lib/docker/containers/container-ID/config.v2.json
Modify the directory location in the configuration file , Then save and exit

"MountPoints":{"/home":{"Source":"/docker","Destination":"/home","RW":true,"Name":"","Driver":"","Type":"bind","Propagation":"rprivate","Spec":{"Type":"bind","Source":"//docker/","Target":"/home"}}}
3, start-up docker service
systemctl start docker.service
4, start-up docker container
docker start <container-name/ID>
Mode 2 : Commit an existing container as a new mirror , Then run it again
$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5a3422adeead ubuntu:14.04 "/bin/bash" About a minute ago Exited (0) About a
minute ago agitated_newton $ docker commit 5a3422adeead newimagename $ docker
run -ti -v "$PWD/dir1":/dir1 -v "$PWD/dir2":/dir2 newimagename /bin/bash
Then stop the old container , And use this new container , If for some reason you need a new container, use the old name , Please use after deleting the old container docker rename.
Mode 3 :export Container is mirror image , then import New image
$docker container export -o ./myimage.docker container ID $docker import
./myimage.docker newimagename $docker run -ti -v "$PWD/dir1":/dir1 -v
"$PWD/dir2":/dir2 newimagename /bin/bash
Then stop the old container , And use this new container , If for some reason you need a new container, use the old name , Please use after deleting the old container docker rename.

Technology
©2020 ioDraw All rights reserved
Swing actual combat Understanding closure about vue in el-date-picker type=daterange The problem of date not echoing Ubuntu 18.04 swap Partition expansion Snake code --c Language Edition visual c++6.0 open 【Golang Basic series 10 】Go language On conditional sentences ifString class —— summary ,String The nature of , Memory resolution , Commonly used APIAdobe Illustrator Publish native support Apple Silicon Test version of the software study java My first class antd table sort