社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
创建容器的命令为:
docker run --privileged -id --name centos centos:centos7.2.1511 bash
问题:Failed to get D-Bus connection: Operation not permitted
创建容器的命令为:
docker run --privileged -id --name centos centos:centos7.2.1511 /usr/sbin/init
在容器中执行命令:
yum install openssh-server
错误信息:Error getting authority: Error initializing authority: Could not connect:No such file or directory (g-io-error-quark, 1)
调整/etc/fstab为如下内容:
在容器中执行命令:
systemctl reboot
执行如下命令:
docker exec -it centos bash #进入容器
systemctl start sshd #在容器中执行命令启动sshd
systemctl status sshd #在容器中查看sshd状态
redhat7.6镜像,进入由该镜像创建的容器时,polkit服务不可用,导致制定systemctl start sshd时报“Authorization not avaliable”,截图如下:
进入容器执行命令:
mv -f /var/run /var/run.runremove~
ln -sfn /run /var/run
mv -f /var/lock /var/lock.lockmove~
ln -sfn /run/lock /var/lock
然后执行:
docker stop 容器
docker start 容器
docker exec -it 容器 bash
重新查看polkit服务正常启动,sshd服务执行无问题,操作截图:
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!