美文网首页
Docker repo&国内源

Docker repo&国内源

作者: 钾肥尔德 | 来源:发表于2020-02-21 16:39 被阅读0次

Doc

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

yum install -y yum-utils \
device-mapper-persistent-data \
lvm2

Repo

yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
  • Enable nightly

yum-config-manager --enable docker-ce-nightly
  • Enable test

yum-config-manager --enable docker-ce-test
  • Install

yum install -y docker-ce docker-ce-cli containerd.io
  • Enable bridge-nf-call-iptables bridge-nf-call-ip6tables

echo "net.ipv4.ip_forward = 1" >> /usr/lib/sysctl.d/00-system.conf
echo "net.bridge.bridge-nf-call-ip6tables = 1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-arptables = 1" >> /etc/sysctl.conf
systemctl restart network
  • Start

systemctl enable docker
systemctl start docker
  • Run docker as a non-root user

usermod -aG docker your-user

国内源

/etc/docker/daemon.json

{
  "registry-mirrors": [
    "http://hub-mirror.c.163.com",
    "http://f1361db2.m.daocloud.io"
  ]
}
systemctl restart docker
docker info
➜  bin docker info
Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: 19.03.6
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 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
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-1062.12.1.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 3.84GiB
 Name: file-server
 ID: 3GTV:LADG:H5VB:YU5X:IUT7:5TIO:BM5I:3C33:CNKB:TJRQ:ZOC2:56UA
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  dockerhub.azk8s.cn
  127.0.0.0/8
 Registry Mirrors:
  https://dockerhub.azk8s.cn/
 Live Restore Enabled: false

相关文章

网友评论

      本文标题:Docker repo&国内源

      本文链接:https://www.haomeiwen.com/subject/tmocqhtx.html