Why must I use shell to run named binary in Docker?


Working with alpine in docker and trying to start named but it only exits (with zero output)

This works
CMD /usr/sbin/named -f -c /etc/bind/named.conf

and is then represented in the docker image as

            "Cmd": (
                "/bin/sh",
                "-c",
                "/usr/sbin/named -f -c /etc/bind/named.conf"

However this does NOT work.

CMD ("/usr/sbin/named", "-f", "-c /etc/bind/named.conf")

Here’s the full Dockerfile, I also use it for CI Test

FROM alpine
RUN apk --no-cache add bind bind-tools bash
CMD /usr/sbin/named -f -c /etc/bind/named.conf