從 2017 年 3 月開始 docker 在原來的基礎上分為兩個分支版本: docker ce 和 docker ee。
docker ce 即社群免費版,docker ee 即企業版,強調安全,但需付費使用。
本文介紹 docker ce 的安裝使用。
移除舊的版本:
$ sudo yum remove docker \安裝一些必要的系統工具:docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
新增軟體源資訊:
sudo yum-config-manager --add-repo更新 yum 快取:
sudo yum makecache fast安裝 docker-ce:
sudo yum -y install docker-ce啟動 docker 後台服務
sudo systemctl start docker測試執行 hello-world
[root@runoob ~]# docker run hello-world報錯
fehler: docker-ce conflicts with 2:docker-1.13.1-75.git8633870.el7.centos.x86_64
fehler: docker-ce-cli conflicts with 2:docker-1.13.1-75.git8633870.el7.centos.x86_64
解決辦法:
解除安裝方式如:
uninstall old versions
# 開始解除安裝
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
# 解除安裝完畢後,進行安裝
yum install docker-ce
# 安裝完畢後啟動
systemctl start docker
# 檢視docker版本
docker --version
2.直接yum 安裝報錯
[root@prod-bj-db-20-48 sysconfig]# systemctl status docker.service
loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
active: failed (result: exit-code) since tue 2019-10-08 17:25:51 cst; 56s ago
docs:
process: 152931 execstart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $options $docker_storage_options $docker_network_options $add_registry $block_registry $insecure_registry $registries (code=exited, status=1/failure)
main pid: 152931 (code=exited, status=1/failure)
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: --tlscert string path to tls certificate file (default "/etc/docker/cert.pem")
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: --tlskey string path to tls key file (default "/etc/docker/key.pem")
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: --tlsverify use tls and verify the remote
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: --userland-proxy use userland proxy for loopback traffic (default true)
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: --userland-proxy-path string path to the userland proxy binary
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: --userns-remap string user/group setting for user namespaces
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: -v, --version print version information and quit
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: run 'dockerd command --help' for more information on a command.
oct 08 17:25:51 prod-bj-db-20-48 dockerd-current[152931]: , code: 125
原因:缺必要外掛程式
請使用本文中安裝方法既可以解決
docker安裝mtproto及報錯解決方案
安裝docker curl ssl sh 給許可權 usermod ag docker current user 啟動 systemctl start docker 驗證 未報錯即成功 docker ps 安裝docker composer curl l compose releases downl...
UOS中docker的安裝及初次使用
sudo apt get remove docker docker engine docker.io containerd runc執行安裝 docker 的命令 apt get install y docker.io 等待安裝完畢,現在我們使用下面的命令啟動 docker systemctl st...
CentOS 安裝 Docker 報錯及解決過程
問題 package docker ce 3 19.03.2 3.el7.x86 64 requires containerd.io 1.2.2 3,but none of the providers can be installed 結果 檢查發現containerd.io此軟體包已經安裝,但版本...