docker 手动安装

安装docker

卸载旧版本(没有则不用):

 sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

复制安装包到服务器:

[root@localhost dockerPackage]# ls
containerd.io-1.4.4-3.1.el7.x86_64.rpm  docker-ce-rootless-extras-20.10.6-3.el7.x86_64.rpm    libseccomp-2.3.1-4.el7.x86_64.rpm
docker-ce-20.10.6-3.el7.x86_64.rpm      docker-ce-selinux-17.03.3.ce-1.el7.noarch.rpm       
docker-ce-cli-20.10.6-3.el7.x86_64.rpm  docker-scan-plugin-0.7.0-3.el7.x86_64.rpm           installDocker.sh
[root@localhost dockerPackage]# rpm -ivh ./*.rpm --force --nodeps

开机自启动:

systemctl enable docker 或 chkconfig docker on

启动docker:

systemctl start docker 或者 service start docker

测试成功否(有网络):

docker run hello-world

使用docker-compose时出现问题

[root@localhost init]# ./init.sh
dir: dzzjwithdocker id: 30ff214768b8

Starting dzzjwithdocker_zhgl_6.1_dzzj_1 ... error

ERROR: for dzzjwithdocker_zhgl_6.1_dzzj_1  Cannot start service zhgl_6.1_dzzj: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/30ff214768b85034d286e2733468b91ea09988cff1343c031472c6f9593343f6/log.json: no such file or directory): runc did not terminate successfully: unknown

ERROR: for zhgl_6.1_dzzj  Cannot start service zhgl_6.1_dzzj: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/30ff214768b85034d286e2733468b91ea09988cff1343c031472c6f9593343f6/log.json: no such file or directory): runc did not terminate successfully: unknown
ERROR: Encountered errors while bringing up the project.
[root@localhost init]# 

最后通过安装 解决
https://centos.pkgs.org/7/centos-x86_64/libseccomp-2.3.1-4.el7.x86_64.rpm.html

yum install libseccomp

猜你喜欢

转载自blog.csdn.net/weixin_44328568/article/details/119040669