yadyn/Dockerfile

52 lines
1.4 KiB
Docker
Raw Normal View History

2019-11-26 16:05:19 +01:00
FROM debian:latest
LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
2019-11-27 14:49:46 +00:00
LABEL ImageName="registry.gitlab.com/wolutator/yadyn"
2019-11-26 16:05:19 +01:00
ARG APP_DIR=/opt/app
ARG VAR_DIR=$APP_DIR/var
ARG DATA_DIR=$VAR_DIR/data
ARG LOG_DIR=$VAR_DIR/log
2019-11-27 14:49:46 +00:00
ARG BIND_DIR=/etc/bind
ARG DYN_ZONES_DIR=$BIND_DIR/dynamic
2019-11-26 16:05:19 +01:00
RUN \
mkdir -p $APP_DIR && \
mkdir -p $VAR_DIR && \
mkdir -p $DATA_DIR && \
mkdir -p $LOG_DIR && \
2019-11-27 14:49:46 +00:00
mkdir -p $DYN_ZONES_DIR && \
2019-11-26 16:05:19 +01:00
apt update && \
apt install -y bind9 && \
2019-11-27 14:49:46 +00:00
apt install -y python && \
apt install -y python-pip && \
apt install -y python-dnspython && \
apt install -y dnsutils && \
apt install -y vim.tiny && \
apt install -y procps && \
/usr/sbin/tsig-keygen local. > /etc/bind/local.key && \
echo "include \"/etc/bind/local.key\";" >> /etc/bind/named.conf && \
echo "include \"/etc/bind/dynamic/dynamic-zones.conf\";" >> /etc/bind/named.conf && \
echo "include \"/etc/bind/named.conf.logging\";" >> /etc/bind/named.conf
2019-11-26 16:05:19 +01:00
COPY ./server/ $APP_DIR
2019-11-27 14:49:46 +00:00
COPY ./bind/named.conf.logging $BIND_DIR
COPY ./bind/dynamic-zones.conf $DYN_ZONES_DIR
COPY ./bind/dynamic.hottis.de $DYN_ZONES_DIR
RUN \
cat /etc/bind/local.key && \
KEY=`cat /etc/bind/local.key | awk -F\" '/secret/ {print $2}'` && \
echo $KEY && \
sed -i "s,KEYVALUE,$KEY," $APP_DIR/yadyn
2019-11-26 16:05:19 +01:00
EXPOSE 8023/tcp
EXPOSE 8053/udp
2019-11-27 14:49:46 +00:00
EXPOSE 53/udp
EXPOSE 53/tcp
2019-11-26 16:05:19 +01:00
VOLUME $VAR_DIR
2019-11-27 14:49:46 +00:00
VOLUME $DYN_ZONES_DIR