转载:https://www.cnblogs.com/woshimrf/p/after-install-docker.html

docker会下载容器,运行会挂载磁盘,所以我们需要把docker装在大容量的分区。

在docker刚刚安装好后,进行下面的修改即可

vim /usr/lib/systemd/system/docker.service

[Service]

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock \

          --graph /data/docker

systemctl daemon-reload

systemctl restart docker

 

=====

安装

https://docs.docker.com/install/linux/docker-ce/centos/

修改位置

查看我们挂载的磁盘

/run/user/0

选择 /data作为docker容器存放地址。

start docker

运行Hello world

//docs.docker.com/get-started/

查看docker info

# docker info Containers: 3 Running: 0 Paused: 0 Stopped: 3 Images: 1 Server Version: 18.09.7 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f init version: fec3683 Security Options: apparmor seccomp Profile: default Kernel Version: 4.18.0-20-generic Operating System: Ubuntu 18.04.2 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 15.54GiB Name: ryan-computer ID: P5ON:MZEK:XB4K:63NP:DTUX:BQHY:72AR:OP4G:JQ2M:JNDL:T6TU:6NEJ Docker Root Dir: /data/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Product License: Community Engine WARNING: No swap limit support

 

相关文章:

  • 2022-02-28
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案