-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (34 loc) · 1.25 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Use Debian Bullseye as the base image
FROM arm64v8/debian:bullseye-20241016
# Set the SHELL to bash with pipefail option
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Update and install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
wget
# Setup Knot repository
RUN wget -O - https://pkg.labs.nic.cz/doc/scripts/enable-repo-cznic-labs.sh | bash -s - knot-resolver
# Install Knot resolver
RUN apt-get update && apt-get install -y --no-install-recommends \
knot-resolver6=6.0.9-cznic.1~bullseye \
knot-dnsutils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /conf
# Create necessary directories and set permissions
RUN mkdir -p /run/knot-resolver \
&& chown knot-resolver:knot-resolver /run/knot-resolver \
&& chmod 775 /run/knot-resolver \
&& chown knot-resolver:knot-resolver /conf
# Copy configuration
COPY --chown=knot-resolver:knot-resolver conf/config.yaml /conf/config.yaml
# Expose plain DNS
EXPOSE 53/UDP 53/TCP
# Switch to knot-resolver user
USER knot-resolver
# Set entrypoint and default command
ENTRYPOINT ["/usr/bin/knot-resolver"]
CMD ["-c", "/conf/config.yaml"]