From abb0608e00d58eeda19c189553e9fb7aa014de0a Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sun, 8 Mar 2020 23:35:02 +0200 Subject: [PATCH] Move from the knot image to Alpine. The builds have been broken for a while. Because the knot image is based on Debian. Use Alpine instead (not because I'm sure the image will be smaller or better, but it's less work to keep the existing Alpine stuff). Also, run as a limited user. --- Dockerfile | 15 +++++++++++---- entrypoint | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0aa9d31..c6369c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,19 @@ -FROM cznic/knot-resolver +FROM alpine:latest RUN echo '@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \ + echo '@community http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \ apk add --update --no-cache \ + bash \ dma@testing \ + gosu@testing \ iproute2 \ + knot-resolver@community \ knot-utils \ mailx \ - mtr -COPY entrypoint /entrypoint + mtr \ + && \ + ln -s /usr/bin/kdig /usr/local/bin/dig && \ + ln -s /usr/bin/khost /usr/local/bin/host +COPY entrypoint /usr/local/sbin/entrypoint WORKDIR / -ENTRYPOINT [ "/entrypoint" ] +ENTRYPOINT [ "entrypoint" ] CMD [ "bash", "--login" ] diff --git a/entrypoint b/entrypoint index 6523ccb..658be82 100755 --- a/entrypoint +++ b/entrypoint @@ -1,5 +1,5 @@ #!/bin/sh -set -eu -echo "net = { '127.0.0.1', '::1'}" | nohup kresd -f1 & +set -eux +kresd --addr '127.0.0.1' --noninteractive & echo 'nameserver 127.0.0.1' > /etc/resolv.conf -eval "exec $@" +eval "exec gosu nobody:nobody $@" -- GitLab