

免费资源网 – https://freexyz.cn/
docker的默认路径存储不足
添加磁盘
永久写入磁盘
[root@localhost ~]# cat /etc/fstab # # /etc/fstab # Created by anaconda on Tue Nov 22 19:08:23 2022 # # Accessible filesystems, by reference, are maintained under /dev/disk # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/centos-root / xfs defaults 0 0 UUID=6638d2be-bc05-4ab2-bc32-d1ae3234d408 /boot xfs defaults 0 0 /dev/mapper/centos-swap swap swap defaults 0 0 UUID=adc0d342-853c-4f5a-b5ff-d8dc65ec9705 /data xfs defaults 0 0 [root@localhost ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 devtmpfs 898M 0 898M 0% /dev tmpfs 910M 0 910M 0% /dev/shm tmpfs 910M 9.5M 901M 2% /run tmpfs 910M 0 910M 0% /sys/fs/cgroup /dev/mapper/centos-root 37G 32G 5.4G 86% / /dev/sda1 1014M 151M 864M 15% /boot tmpfs 182M 0 182M 0% /run/user/0 /dev/sdb1 100G 33M 100G 1% /data迁移docker数据
[root@localhost ~]# systemctl stop docker Warning: Stopping docker.service, but it can still be activated by: docker.socket [root@localhost ~]# systemctl stop docker.socket [root@localhost ~]# [root@localhost ~]# mkdir /data/docker 同步docker镜像数据 nohup rsync -avz /var/lib/docker/ /data/docker/ & cp -r /var/lib/docker/ /data/docker/ 编辑/etc/docker/daemon.json,添加参数,将docker的目录迁移绑定 “data-root “: “/data/docker” [root@localhost ~]# systemctl restart dockergraph 1.17以前
–data-root 1.17以后
[root@localhost ~]# docker info Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Build with BuildKit (Docker Inc., v0.6.3-docker) scan: Docker Scan (Docker Inc., v0.23.0) Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 265 Server Version: 20.10.9 Storage Driver: overlay2 Backing Filesystem: xfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: cgroupfs Cgroup Version: 1 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux Default Runtime: runc Init Binary: docker-init containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc version: v1.1.12-0-g51d5e94 init version: de40ad0 Security Options: seccomp Profile: default Kernel Version: 3.10.0-1160.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 CPUs: 2 Total Memory: 1.777GiB Name: localhost.localdomain ID: V2R4:D3LK:M35M:NUSH:PCXP:XSBF:O5RF:YSHX:ZOMV:RC4G:3DFJ:6J3Q Docker Root Dir: /data/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 192.168.12.97 39.156.86.16:50000 harbor.inspur.local nexus.inspur.local registry.cn-beijing.aliyuncs.com registry.cn-hangzhou.aliyuncs.com 10.110.63.67 127.0.0.0/8 Registry Mirrors: https://38ov96r5.mirror.aliyuncs.com/ Live Restore Enabled: false总结
© 版权声明
THE END
暂无评论内容