Docker 如何正确启动 Apache

问题描述

docker报错:
System has not been booted with systemd as init system (PID 1). Can‘t operate.
Failed to connect to bus: Host is down

解决办法

1
2
3
4
5
6
7
8
9
# 运行centos
# docker run -itd --name centos centos /bin/bash

# 替换为:
# 获取systemctl权限
docker run --privileged -itd --name centos centos /usr/sbin/init

# 进入终端
docker exec -it centos /bin/bash