How to start a Service in an Alpine Container
#1 Thu, 2017-05-11 20:41
- 3 months 3 weeks ago
I'm trying to create a container that runs bind as a forward only DNS resolver that will start with the container. Below is my Dockerfile where I install the bind & openrc a-packs. What should I be doing to start the named service ?
FROM gliderlabs/alpine:latest RUN apk --update --no-cache add\ bind\ openrc COPY named.conf /etc/bind EXPOSE 53/udp 53/tcp CMD "rc-update add named boot"
which builds successfully but immediately exits when running the container with
docker run --name dns -d --publish 53:53/tcp --publish 53:53/udp <container id>. I'm not sure how I should be interpreting the log message. It seems to be me the /bin/sh is telling me the rc-service binary is not in $PATH. However changing the CMD parameter to
/sbin/rc-update add named bootdidn't work either:
$ docker logs dns /bin/sh: rc-service named start: not found