how can i run sshd on alpine from docker

3 posts / 0 new
Last post
#1 Wed, 2017-01-04 13:44
zorelu
  • zorelu's picture
  • Offline
  • Last seen: 1 year 2 months ago
  • Joined: 2017-01-04

step1 , i run alpine the docker just like this `docker run -it alpine /bin/bash`
step2, i install openssh and openrc
step3, i run `rc-update add sshd` and then run

 
bash-4.3# /etc/init.d/sshd start
 * WARNING: sshd is already starting
bash-4.3# ps -ef
PID   USER     TIME   COMMAND
    1 root       0:00 /bin/bash
   23 root       0:00 ps -ef`
 


i found the sshd didn't work .

so i try run `rc-service sshd start` but the wroing

bash-4.3# rc-service sshd start
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/blkio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpu/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpuacct/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpuset/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/devices/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/freezer/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/hugetlb/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/memory/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/net_cls/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/net_prio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/perf_event/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/systemd/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/blkio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpu/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpuacct/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpuset/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/devices/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/freezer/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/hugetlb/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/memory/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/net_cls/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/net_prio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/perf_event/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/systemd/tasks: Read-only file system
 * You are attempting to run an openrc service on a
 * system which openrc did not boot.
 * You may be inside a chroot or you may have used
 * another initialization system to boot this system.
 * In this situation, you will get unpredictable results!
 * If you really want to do this, issue the following command:
 * touch /run/openrc/softlevel
 * ERROR: sshd failed to start

so what can i run the openssh-server?please help me.

Thu, 2017-04-27 01:48
tfluehmann
  • tfluehmann's picture
  • Offline
  • Last seen: 11 months 1 week ago
  • Joined: 2017-04-27

+1 I have exactly the same issue with the latest alpine docker image.

Sun, 2017-05-07 21:54
pwFoo
  • pwFoo's picture
  • Offline
  • Last seen: 7 months 1 week ago
  • Joined: 2015-08-27

I think you have to start it without the init script. sshd with the full path. Maybe generate keys before (sshd will tell you if needed).

Log in or register to post comments