* docker ps --no-trunc --format 'table {{.ID}}\t{{.Names}}' # list running containers and their id's
* cd /var/lib/docker/containers/<container id> # cd to desired container
* systemctl stop docker.service # otherwise changes will be overwritten when re-starting
* vim <(jq . config.v2.json) # prettify json and load it into vim / vi
* :/MountP # search for MountPoints
"MountPoints": {
"/app/dockerdir": {
"Source": "/home/myuser/dockerdir",
"Destination": "/app/dockerdir",
"RW": true,
"Name": "",
"Driver": "",
"Type": "bind",
"Propagation": "rprivate",
"Spec": {
"Type": "bind",
"Source": "/home/myuser/dockerdir/",
"Target": "/app/dockerdir/"
},
"SkipMountpointCreation": false
},
* Add insert additional mounts
* :wq! config.v2.json # save and config.v2.json and quit
* systemctl start docker.service # start docker service
Last active
June 9, 2023 12:51
-
-
Save agail/276d8a41390ab27424d5efc884fffab3 to your computer and use it in GitHub Desktop.
Add docker volume to running container
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment