1. 先启动centos 镜像 然后 再docker cp文件 然后再执行安装报错
[root@CentOS75 ~]# docker run -it centos /bin/bash [root@1d65d032b176 /]# rpm -ivh d dev/ docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm [root@1d65d032b176 /]# rpm -ivh docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm --nodeps warning: docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY Preparing... ################################# [100%] Updating / installing... 1:docker-ce-18.03.1.ce-1.el7.centos################################# [100%] [root@1d65d032b176 /]# systemctl start docker Failed to get D-Bus connection: Operation not permitted [root@1d65d032b176 /]#
2. 根据错误信息 查找解决方案
https://blog.csdn.net/xiaochonghao/article/details/64438246
docker run --privileged -ti -e "container=docker" centos /usr/sbin/init
不知道密码