Skip to content

Commit

Permalink
Updates for Docksal
Browse files Browse the repository at this point in the history
  • Loading branch information
lmakarov committed Oct 12, 2016
1 parent fa74920 commit ee3f515
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.4

MAINTAINER Leonid Makarov <leonid.makarov@blinkreaction.com>
MAINTAINER Leonid Makarov <leonid.makarov@ffwagency.com>

RUN apk add --no-cache \
curl \
Expand All @@ -23,9 +23,9 @@ COPY conf/dnsmasq.tmpl /etc/dnsmasq.d/dockergen.tmpl
COPY conf/supervisord.conf /etc/supervisor.d/docker-gen.ini
COPY entrypoint.sh /opt/entrypoint.sh

# Default IP for Drude
ENV DNS_IP '192.168.10.10'
ENV DNS_ZONE 'localzone'
# Default domain and IP for wildcard query resolution
ENV DNS_DOMAIN 'docksal'
ENV DNS_IP '192.168.64.100'
ENV LOG_QUERIES false

EXPOSE 53/udp
Expand Down
12 changes: 6 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ set -e

# Default command (assuming container start)
if [ "$1" = 'supervisord' ]; then
# $DNS_ZONE IP config for dnsmasq
touch /etc/dnsmasq.d/${DNS_ZONE}.conf
# Resolve *.$DNS_ZONE to $DNS_IP
echo "address=/${DNS_ZONE}/${DNS_IP}" >> /etc/dnsmasq.d/${DNS_ZONE}.conf
# Reverse resolution of $DNS_IP to ${DNS_ZONE}
echo $DNS_IP | awk -v dzone=${DNS_ZONE} -F . '{print "ptr-record="$4"."$3"."$2"."$1".in-addr.arpa,"dzone}' >> /etc/dnsmasq.d/${DNS_ZONE}.conf
# $DNS_DOMAIN IP config for dnsmasq
touch /etc/dnsmasq.d/${DNS_DOMAIN}.conf
# Resolve *.$DNS_DOMAIN to $DNS_IP
echo "address=/${DNS_DOMAIN}/${IP}" >> /etc/dnsmasq.d/${DNS_DOMAIN}.conf
# Reverse resolution of $DNS_IP to ${DNS_DOMAIN}
echo $DNS_IP | awk -v dzone=${DNS_DOMAIN} -F . '{print "ptr-record="$4"."$3"."$2"."$1".in-addr.arpa,"dzone}' >> /etc/dnsmasq.d/${DNS_DOMAIN}.conf

# Turn query loggin on
if [ "$LOG_QUERIES" = true ]; then
Expand Down

0 comments on commit ee3f515

Please sign in to comment.