Docker version:
[email protected] ~]# Docker versionclient:
version:1.10.3
API version:1.22
Package version:docker-common-1.10.3-46.el7.centos.10.x86_64
Go version:go1.6.3
Git commit:d381c64-unsupported
Built:thu 4 13:21:17 2016
Os/arch:linux/amd64
Server:
version:1.10.3
API version:1.22
Package version:docker-common-1.10.3-46.el7.centos.10.x86_64
Go version:go1.6.3
Git commit:d381c64-unsupported
Built:thu 4 13:21:17 2016
os/arch:linux/amd64123456789101112131415161718
Mirrored version
[[email protected]/]# cat/etc/redhat-releasecentos Linux release 7.2.1511 (Core) 12
When you start a service through Systemctl in Docker, you always report an error such as failed to get D-bus connection:operation not permitted.
[[email protected] ~]# systemctl start sshd
Failed to get D-bus connection:operation not permitted
The solution is to run/usr/sbin/init at Docker run. Like what:
[email protected]/]# Docker Run-tid--name hadoopbase centos/hadoopbase:v001/usr/sbin/init
In this way, container can use SYSTEMCTL to start the service, some people say in the CentOS7.2 to solve the problem through the Systemctl run error, but I still encounter such problems in the actual operation.
There is also a workaround, that is, when the image file generated through the Dockerfile, through the cmd to execute/usr/sbin/init this command, namely: cmd ["/usr/sbin/init"];
Start MySQL in Docker error: Failed to get D-bus connection