Dockerfile
FROM centos:7
ENV container docker
VOLUME ["/sys/fs/cgroup"]
RUN yum -y update
RUN yum install -y httpd
RUN systemctl start httpd.service
ADD . /code
WORKDIR /code
码头工人-compose.yml
version: '2'
services:
web:
privileged: true
build: .
ports:
- "80:80"
volumes:
- .:/code
命令
docker-compose build
错误:
第 6 步:运行 systemctl start httpd.service ---> Running in 5989c6576ac9 ?[91mFailed to get D-Bus connection: Operation not allowed ?[0m?[31mERROR?[0m: Service 'web' failed to build: The command' /bin/sh -c syste mctl start httpd.service' 返回一个非零代码:1
Obs : 在 Windows 7 上运行 :(
任何提示?