\r\nroot@linuxcool:~# apt-get -y update\r\nroot@linuxcool:~# apt-get -y install docker-ce\r\n<\/pre>\n\u901a\u8fc7\u4ee5\u4e0a\u547d\u4ee4\u5b89\u88c5\u7684\u662fdocker\u6700\u65b0\u7248\u672c\uff0c\u5982\u679c\u8981\u5b89\u88c5docker\uff0c\u8bf7\u7ee7\u7eed\u9605\u8bfb\u4e0b\u6587\uff0c<\/p>\n
\u67e5\u627eDocker-CE\u7684\u7248\u672c<\/p>\n
\r\napt-cache madison docker-ce\r\n docker-ce | 5:19.03.8~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:19.03.7~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:19.03.6~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:19.03.5~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:19.03.4~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:19.03.3~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:19.03.2~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:19.03.1~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:19.03.0~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.9~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.8~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.7~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.6~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.5~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.4~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.3~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.2~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.1~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 5:18.09.0~3-0~ubuntu-bionic | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 18.06.3~ce~3-0~ubuntu | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 18.06.2~ce~3-0~ubuntu | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 18.06.1~ce~3-0~ubuntu | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 18.06.0~ce~3-0~ubuntu | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n docker-ce | 18.03.1~ce~3-0~ubuntu | https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu bionic\/stable amd64 Packages\r\n<\/pre>\n\u5b89\u88c5\u6307\u5b9a\u7248\u672c\u7684Docker-CE\uff0c\u6bd4\u5982\u8981\u5b89\u88c519.03.8~3-0~ubuntu-bionic<\/p>\n
\r\nroot@linuxcool:~# apt-get -y install docker-ce=19.03.8~3-0~ubuntu-bionic\r\n<\/pre>\n\u5b89\u88c5\u6821\u9a8c<\/strong><\/span><\/div>\n\r\nroot@linuxcool:~# docker version\r\nClient: Docker Engine - Community\r\n Version: 19.03.8\r\n API version: 1.40\r\n Go version: go1.12.17\r\n Git commit: afacb8b7f0\r\n Built: Wed Mar 11 01:25:46 2020\r\n OS\/Arch: linux\/amd64\r\n Experimental: false\r\n\r\nServer: Docker Engine - Community\r\n Engine:\r\n Version: 19.03.8\r\n API version: 1.40 (minimum version 1.12)\r\n Go version: go1.12.17\r\n Git commit: afacb8b7f0\r\n Built: Wed Mar 11 01:24:19 2020\r\n OS\/Arch: linux\/amd64\r\n Experimental: false\r\n containerd:\r\n Version: 1.2.13\r\n GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429\r\n runc:\r\n Version: 1.0.0-rc10\r\n GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd\r\n docker-init:\r\n Version: 0.18.0\r\n GitCommit: fec3683\r\n<\/pre>\n\u914d\u7f6e\u955c\u50cf\u52a0\u901f<\/strong><\/span><\/div>\n\u521b\u5efadaemon.json\u914d\u7f6e\u6587\u4ef6<\/p>\n
\r\nroot@linuxcool:~# vim \/etc\/docker\/daemon.json\r\n{\r\n \"registry-mirrors\": [\"https:\/\/dockerhub.mirrors.nwafu.edu.cn\/\"]\r\n}\r\n<\/pre>\n\u9ed8\u8ba4daemon.json\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5982\u679cdaemon.json\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u81ea\u5df1\u521b\u5efa<\/p>\n
\u52a0\u8f7d\u914d\u7f6e\uff0c\u91cd\u542fdocker\u670d\u52a1<\/strong><\/span><\/div>\n\r\nroot@linuxcool:~# systemctl daemon-reload\r\nroot@linuxcool:~# systemctl restart docker\r\n<\/pre>\n\u9a8c\u8bc1\u955c\u50cf\u52a0\u901f\u662f\u5426\u914d\u7f6e\u751f\u6548<\/strong><\/span><\/div>\n\r\nroot@linuxcool:~# docker info \r\nClient:\r\n Debug Mode: false\r\n\r\nServer:\r\n Containers: 0\r\n Running: 0\r\n Paused: 0\r\n Stopped: 0\r\n Images: 0\r\n Server Version: 19.03.8\r\n Storage Driver: overlay2\r\n Backing Filesystem: \r\n Supports d_type: true\r\n Native Overlay Diff: true\r\n Logging Driver: json-file\r\n Cgroup Driver: cgroupfs\r\n Plugins:\r\n Volume: local\r\n Network: bridge host ipvlan macvlan null overlay\r\n Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog\r\n Swarm: inactive\r\n Runtimes: runc\r\n Default Runtime: runc\r\n Init Binary: docker-init\r\n containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429\r\n runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd\r\n init version: fec3683\r\n Security Options:\r\n apparmor\r\n seccomp\r\n Profile: default\r\n Kernel Version: 5.3.0-51-generic\r\n Operating System: Ubuntu 18.04.4 LTS\r\n OSType: linux\r\n Architecture: x86_64\r\n CPUs: 8\r\n Total Memory: 15.64GiB\r\n Name: linuxcool\r\n ID: K252:G32L:GWWN:J5FE:3MFZ:2ITG:UE7Y:Y26F:QT3Q:2PLS:HCUX:PJYZ\r\n Docker Root Dir: \/var\/lib\/docker\r\n Debug Mode: false\r\n Registry: https:\/\/index.docker.io\/v1\/\r\n Labels:\r\n Experimental: false\r\n Insecure Registries:\r\n 127.0.0.0\/8\r\n Registry Mirrors:\r\n https:\/\/dockerhub.mirrors.nwafu.edu.cn\/\r\n Live Restore Enabled: false\r\n\r\nWARNING: No swap limit support\r\n<\/unknown><\/pre>\nRegistry Mirrors\u9ed8\u8ba4\u662fdocker.io\uff0c\u5982\u679c\u770b\u5230Registry Mirrors\u53d8https:\/\/dockerhub.mirrors.nwafu.edu.cn\u8bf4\u660e\u914d\u7f6e\u5df2\u7ecf\u751f\u6548\u3002<\/p>\n
docker\u670d\u52a1\u7ba1\u7406<\/strong><\/span><\/div>\n\r\n#\u81ea\u542f\u670d\u52a1\r\nroot@linuxcool:~# systemctl enable docker.service\r\n#\u670d\u52a1\u72b6\u6001\r\nroot@linuxcool:~# systemctl status docker.service\r\n#\u542f\u52a8\u670d\u52a1\r\nroot@linuxcool:~# systemctl start docker.service\r\n#\u91cd\u542f\u670d\u52a1\r\nroot@linuxcool:~# systemctl restart docker.service\r\n#\u505c\u6b62\u670d\u52a1\r\nroot@linuxcool:~# systemctl stop docker.service\r\n<\/pre>\n\u62c9\u53d6\u955c\u50cf<\/strong><\/span><\/div>\n\r\nroot@linuxcool:~# docker pull centos:8.1.1911\r\n8.1.1911: Pulling from library\/centos\r\n8a29a15cefae: Pull complete \r\nDigest: sha256:fe8d824220415eed5477b63addf40fb06c3b049404242b31982106ac204f6700\r\nStatus: Downloaded newer image for centos:8.1.1911\r\ndocker.io\/library\/centos:8.1.1911\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u64cd\u4f5c\u7cfb\u7edf\uff1aUbuntu 18.04.4 LTS LAN IP \uff1a192.168.3.22 Docker\u662f\u73b0\u4ee3\u8f6f […]<\/p>\n","protected":false},"author":1479,"featured_media":192273,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-192272","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/192272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1479"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=192272"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/192272\/revisions"}],"predecessor-version":[{"id":194177,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/192272\/revisions\/194177"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/192273"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=192272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=192272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=192272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}