After using CentOS 7 image to create a container, you may encounter such a problem that you use systemctl to start the service and report an error. For this error report, let’s analyze it next!
# docker run -itd –name centos7 centos:7
# docker attach centos7
# yum install vsftpd
# systemctl start vsftpd
Failed to get D-Bus connection: Operation not permitted
The reasons are as follows:
The design concept of docker is that there is no background service running in the container. The container itself is an independent main process on the host, which can also be indirectly understood as the application process running the service in the container. The life cycle of a container exists around the main process, so the correct way to use the container is to run the services in the foreground.
When it comes to SYSTEMd, this suite has become the default service management for mainstream Linux distributions (such as centos7 and Ubuntu 14 +), replacing the traditional Systemv style service management. SYSTEMd maintains system services, which require privileges to access the Linux kernel. The container is not a complete operating system, there is only one file system, and the default startup is only for ordinary users to access the Linux kernel, that is, there is no privilege, so it can’t be used naturally!
Therefore, please follow the container design principles and run a foreground service in one container!!!
Yes, run the container in privileged mode.
The solution is as follows:
# docker run -d -name centos7 –privileged=true centos:7 /usr/sbin/init
# docker exec -it centos7 /bin/bash
This allows you to start the service using systemctl
- [Solved] CentOS build a docker error: job for docker.service failed….
- Docker service startup error: Job for docker.service failed because the control process exited with error code.
- [Solved] Docker Error: Failed to connect to bus: Host is down
- Docker Open Error: Warning: docker.service changed on disk. Run ‘systemctl daemon-reload‘ to reload unit
- Docker run Error: container_linux.go:235: starting container process caused “process_linux.go:258: appl
- [Solved] Docker Startup Error: panic: runtime error: invalid memory address or nil pointer dereference
- [Solved] ERROR: for jms_koko Cannot start service koko: driver failed programming
- How to Solve k8s Nodal issues: /sys/fs/cgroup/memory/docker: no space left on device\““: unknown.
- How to Solve VMware Workstation Error: The VMware Authorization Service is not running.
- [Solved] Postgres Start Error: Job for postgresql.service failed because the control process exited with error code.
- How to Solve Rabbitmq Error: Failed to start RabbitMQ broker
- Docker Create tomcat Error standard_init_linux.go:211: exec user process caused “no such file or directory”
- Nacos Error: server is DOWN now, please try again later! [How to Solve]
- Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen is reported when docker port mapping or starting the container
- How to Fix Error 1069:The service did not start due to a logon failure
- ArchLinux starts error after modifying MariaDB database path Can’t create test file /xxxxx/xxxxx-test
- MAC: How to modify the docker container error [screen is terminating]
- Failed to copy files Error processing tar file [How to Solve]
- [environment] docker: error response from daemon: OCI runtime
- Error in node when PM2 starts multiple processes in docker