admin 发表于 2022-4-24 17:22:34

修改docker配置文件,改变挂载目录

# systemctlstop docker.service
Warning: Stopping docker.service, but it can still be activated by:
docker.socket
# systemctl statusdocker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2022-04-24 17:08:22 CST; 37s ago
   Docs: https://docs.docker.com
Main PID: 13045 (dockerd)
    Tasks: 39
   Memory: 44.5M
   CGroup: /system.slice/docker.service
         └─13045 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd...
Apr 24 17:08:22 biedong-weixian dockerd: time="2022-04-24T17:08:22.076423951..."
Apr 24 17:08:22 biedong-weixian dockerd: time="2022-04-24T17:08:22.079698949+...
Apr 24 17:08:22 biedong-weixian dockerd: time="2022-04-24T17:08:22.354332877..."
Apr 24 17:08:22 biedong-weixian dockerd: time="2022-04-24T17:08:22.454061208..."
Apr 24 17:08:22 biedong-weixian dockerd: time="2022-04-24T17:08:22.495319160...4
Apr 24 17:08:22 biedong-weixian dockerd: time="2022-04-24T17:08:22.495469989..."
Apr 24 17:08:22 biedong-weixian systemd: Started Docker Application Container E...e.
Apr 24 17:08:22 biedong-weixian dockerd: time="2022-04-24T17:08:22.550368036..."
Apr 24 17:08:33 biedong-weixian dockerd: time="2022-04-24T17:08:33.634799553..."
Apr 24 17:08:34 biedong-weixian dockerd: time="2022-04-24T17:08:34.700626020..."
Hint: Some lines were ellipsized, use -l to show in full.
# systemctl stopdocker.service
Warning: Stopping docker.service, but it can still be activated by:
docker.socket
# systemctl stopdocker.servicedocker.socket
# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
#
# vim/var/lib/docker/containers/container-ID/config.v2.json
# vim /var/lib/docker
docker/   dockershim/
# vim /var/lib/docker
docker/   dockershim/
# vim /var/lib/docker/
buildkit/   image/      overlay2/   runtimes/   tmp/      volumes/   
containers/ network/    plugins/    swarm/      trust/      
# vim /var/lib/docker/
buildkit/   image/      overlay2/   runtimes/   tmp/      volumes/   
containers/ network/    plugins/    swarm/      trust/      
# vim /var/lib/docker/containers/
06b7fb8ff674e24454d40648c0dd096ba7418e2eb1ff1b5abcc802a88a0ee1ff/
0b80a41556e93453221e148eff709e21a41f1175346c9891dfc3d6cf6101ef36/
130c117ff32ce78c88161e54619c390b977c116bbc7e1d5a9966f37af725e8d6/
22ec5f33d3252fa02703de9c4f31068bad8eaf7b728ad9ea99815e23c802e31a/
2c691673c4686a66a8e165609ab2e0e20a51c2c9508567dc2c7f3761c0ff2868/
369e319090309f08558a66b661582fdc54027e5b33f44fbce9bc9c75d701fe47/
37005829b6dd6efed076ac4602415be62734ef11860c603d44fafec183e5d466/
3a61da43b54a961a7b913603166cceb2ebb82088dd6a83c730a32c1af7e5313b/
49677c69fd091f62716a5bb1591b63d6f967e69789ae41772050e998f0fd0770/
4c4382110db3f140ea363fc9ff03c003c22c2d5c4f4e8e432de20193964982eb/
53ba7c007ac1c4ffe2e8be09c0152412fb82fc1d9041f561eb6e37663e8ab90f/
53e64b02d870ba51cf8798154d72340644d62f1fd52a9b79a2493332115c8a33/
5ee608f327ff9d2e6add239e37df91774421271ba27cbbf988fa5bcaa4991c73/
6451c93d0b2bb366cff542f8c0cb389b33635aad14a7513577ca3b19df3cd873/
6d3e88fd034d98ac399d34dcce70575c84838d06428ce4550bc52e49fa04a202/
6d783f8ac8b11e48874599e81fc6465638bae2ef696111453efc53e022ca730a/
6f4f7a286f932cfca69c4004fdcc6abbc509398bc1275d68596fef21ea23565f/
79c7f3e03774172983d69037f16f80aa62eeb54a8b5e08d7147db869548798ed/
86fa4fdf5e9fd5ea3968ff93c7cfe61288e92afa3cccd854bca9d468060f0fa9/
9041ddf91a6578eec265e64e40249b29b443e07eea820e7ffeba35f0e3b0fef1/
9098d413bb265bce20e860ddaec01cdbd68e9234d91698dfa645a9cccd41910e/
962bc0abd29275e6fd0b46646d8ebffbead0c1cd3b934ac12c9170e16521b481/
9a4d8eb4a5251af63bc33f2237a734a6431c1900efd099d3dc56d80a92cdbc51/
a2fbd0483894723650a2351844ac6cd5092c4a885bac9c599f4d270abdea09e8/
a579cf50ece1a72dc807303cd845a0bafc736ca9ef95b6a7a45ae98edf80008b/
b1875a17936d48f671512fd9297509b588e2a4081ce288609a4c342a11056302/
ccac61286e72d2750910b786aac679a05689da34df65e41f71bb42db1d46b727/
d240a9ca0ecdf7dc3dda3710dad851062dec37bf0f2b3b8175a0949b1eccf469/
ebf4e045cbc399a7946949528238493a8b17d006c46fc2203ff336b22650f691/
f6f5a9b59384f0612635e4a93dcf66a379dc1872b09ec3988891808ae4383ae8/
f803407094115fef297d3f454f7b1cc539a0ca930a4174dee5bf4bb9de95fc6c/
# vim /var/lib/docker/containers/
06b7fb8ff674e24454d40648c0dd096ba7418e2eb1ff1b5abcc802a88a0ee1ff/
0b80a41556e93453221e148eff709e21a41f1175346c9891dfc3d6cf6101ef36/
130c117ff32ce78c88161e54619c390b977c116bbc7e1d5a9966f37af725e8d6/
22ec5f33d3252fa02703de9c4f31068bad8eaf7b728ad9ea99815e23c802e31a/
2c691673c4686a66a8e165609ab2e0e20a51c2c9508567dc2c7f3761c0ff2868/
369e319090309f08558a66b661582fdc54027e5b33f44fbce9bc9c75d701fe47/
37005829b6dd6efed076ac4602415be62734ef11860c603d44fafec183e5d466/
3a61da43b54a961a7b913603166cceb2ebb82088dd6a83c730a32c1af7e5313b/
49677c69fd091f62716a5bb1591b63d6f967e69789ae41772050e998f0fd0770/
4c4382110db3f140ea363fc9ff03c003c22c2d5c4f4e8e432de20193964982eb/
53ba7c007ac1c4ffe2e8be09c0152412fb82fc1d9041f561eb6e37663e8ab90f/
53e64b02d870ba51cf8798154d72340644d62f1fd52a9b79a2493332115c8a33/
5ee608f327ff9d2e6add239e37df91774421271ba27cbbf988fa5bcaa4991c73/
6451c93d0b2bb366cff542f8c0cb389b33635aad14a7513577ca3b19df3cd873/
6d3e88fd034d98ac399d34dcce70575c84838d06428ce4550bc52e49fa04a202/
6d783f8ac8b11e48874599e81fc6465638bae2ef696111453efc53e022ca730a/
6f4f7a286f932cfca69c4004fdcc6abbc509398bc1275d68596fef21ea23565f/
79c7f3e03774172983d69037f16f80aa62eeb54a8b5e08d7147db869548798ed/
86fa4fdf5e9fd5ea3968ff93c7cfe61288e92afa3cccd854bca9d468060f0fa9/
9041ddf91a6578eec265e64e40249b29b443e07eea820e7ffeba35f0e3b0fef1/
9098d413bb265bce20e860ddaec01cdbd68e9234d91698dfa645a9cccd41910e/
962bc0abd29275e6fd0b46646d8ebffbead0c1cd3b934ac12c9170e16521b481/
9a4d8eb4a5251af63bc33f2237a734a6431c1900efd099d3dc56d80a92cdbc51/
a2fbd0483894723650a2351844ac6cd5092c4a885bac9c599f4d270abdea09e8/
a579cf50ece1a72dc807303cd845a0bafc736ca9ef95b6a7a45ae98edf80008b/
b1875a17936d48f671512fd9297509b588e2a4081ce288609a4c342a11056302/
ccac61286e72d2750910b786aac679a05689da34df65e41f71bb42db1d46b727/
d240a9ca0ecdf7dc3dda3710dad851062dec37bf0f2b3b8175a0949b1eccf469/
ebf4e045cbc399a7946949528238493a8b17d006c46fc2203ff336b22650f691/
f6f5a9b59384f0612635e4a93dcf66a379dc1872b09ec3988891808ae4383ae8/
f803407094115fef297d3f454f7b1cc539a0ca930a4174dee5bf4bb9de95fc6c/
# vim /var/lib/docker/containers/06b7fb8ff674e24454d40648c0dd096ba7418e2eb1ff1b5abcc802a88a0ee1ff/
06b7fb8ff674e24454d40648c0dd096ba7418e2eb1ff1b5abcc802a88a0ee1ff-json.log
checkpoints/
config.v2.json
hostconfig.json
hostname
hosts
mounts/
resolv.conf
# vim /var/lib/docker/containers/06b7fb8ff674e24454d40648c0dd096ba7418e2eb1ff1b5abcc802a88a0ee1ff/
06b7fb8ff674e24454d40648c0dd096ba7418e2eb1ff1b5abcc802a88a0ee1ff-json.log
checkpoints/
config.v2.json
hostconfig.json
hostname
hosts
mounts/
resolv.conf
# vim /var/lib/docker/containers/06b7fb8ff674e24454d40648c0dd096ba7418e2eb1ff1b5abcc802a88a0ee1ff/config.v2.json


随后重启即可:
页: [1]
查看完整版本: 修改docker配置文件,改变挂载目录