Subject: [alpine-user] Open RC SSH Docker

From: Gabor Toth <[email-masked]>
Date: Thu, 31 May 2018 18:14:08 -0400

Dear All,

I am installing ssh and openrc in an Alpine based docker (8-alpine). To run
ssh as a service, I wanted to use openrc. However, if I simply add "apk add
openrc --no-cache" to my docker file, I get a bunch of error messages (see
below) when running the container with the new image (I use a precomputed
init script  in which I run 'openrc boot' and then 'openrc -s sshd start')

If I include all the additional - not very clear- code from here
https://github.com/dockage/alpine-openrc/blob/master/Dockerfile, things
seem to be working fine.

However, we would like to keep our Docker file clean without a great amount
of unclear code. So I am wondering if there is any straight-forward way to
install openssh, then a service manager tool that starts it upon booting.

Thanks,

Gabor

Error messages.

child process started successfully, parent exiting
 * Caching service dependencies ...
Service `hwdrivers' needs non existent service `dev'

                         [ ok ]
 * Caching service dependencies ...
Service `hwdrivers' needs non existent service `dev'

                         [ ok ]
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/blkio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create /sys/fs/cgroup/cpu/tasks:
Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/cpuacct/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/cpuset/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/devices/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/freezer/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/hugetlb/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/memory/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/net_cls/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/net_prio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/perf_event/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create /sys/fs/cgroup/pids/tasks:
Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/systemd/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/blkio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create /sys/fs/cgroup/cpu/tasks:
Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/cpuacct/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/cpuset/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/devices/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/freezer/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/hugetlb/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/memory/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/net_cls/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/net_prio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/perf_event/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create /sys/fs/cgroup/pids/tasks:
Read-only file system
/lib/rc/sh/openrc-run.sh: line 273: can't create
/sys/fs/cgroup/systemd/tasks: Read-only file system

---

From: Daniel Isaksen <[email-masked]>
Date: Fri, 1 Jun 2018 06:14:07 +0200

Thing is, most service managers have to be PID 1. It should work if you
take that into consideration.

- Daniel

On Fri, Jun 1, 2018, 12:14 AM Gabor Toth <[email-masked]>
wrote:

> Dear All,
>
> I am installing ssh and openrc in an Alpine based docker (8-alpine). To
> run ssh as a service, I wanted to use openrc. However, if I simply add "apk
> add openrc --no-cache" to my docker file, I get a bunch of error messages
> (see below) when running the container with the new image (I use a
> precomputed init script  in which I run 'openrc boot' and then 'openrc -s
> sshd start')
>
> However, we would like to keep our Docker file clean without a great
> amount of unclear code. So I am wondering if there is any straight-forward
> way to install openssh, then a service manager tool that starts it upon
> booting.
>
> Thanks,
>
> Gabor
>
>
>
>
> Error messages.
>
>
> /sys/fs/cgroup/pids/tasks: Read-only file system
> /sys/fs/cgroup/pids/tasks: Read-only file system