-
Notifications
You must be signed in to change notification settings - Fork 558
Open
Description
This is my Dockerfile
FROM centos:7
RUN yum install -y initscripts openssh-server vim
RUN echo 'root:pass' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/#Port 22/Port 22/' /etc/ssh/sshd_config
RUN service ssh start ; sleep infinity
EXPOSE 22
I install initscripts follow with this instruction for service command but not work anymore while building. Like below.
Error output when building image
Step 6/7 : RUN service ssh start ; sleep infinity
---> Running in b3a8b35f13b6
Redirecting to /bin/systemctl start ssh.service
Failed to get D-Bus connection: Operation not permitted
I know that systemd can't run on docker. But, how to solve this?
Thank you!
Metadata
Metadata
Assignees
Labels
No labels