Browse Source

Add debugging output + build script

master 0.3.1
Nico Schottelius 1 year ago
parent
commit
6f9c38783d
  1. 3
      Dockerfile
  2. 11
      build.sh
  3. 18
      entrypoint.sh

3
Dockerfile

@ -1,7 +1,6 @@
FROM nginx:1.21.3-alpine
RUN apk update
RUN apk add certbot
RUN apk update && apk add certbot bind-tools
COPY entrypoint.sh /
CMD ["/entrypoint.sh"]

11
build.sh

@ -0,0 +1,11 @@
#!/bin/sh
set -e
docker build -t ungleich-certbot .
while [ $# -ge 1 ]; do
tag=$1; shift
docker tag ungleich-certbot:latest ungleich/ungleich-certbot:${tag}
docker push ungleich/ungleich-certbot:${tag}
done

18
entrypoint.sh

@ -5,6 +5,24 @@ if [ -z "$DOMAIN" -o -z "$EMAIL" ]; then
exit 1
fi
# Check that the domain exists, if not wait for it
ipv6_addr=""
ipv4_addr=""
while [ -z "$ipv6_addr" -a -z "$ipv4_addr" ]; do
echo "Trying to resolve $DOMAIN via DNS ..."
# Resolve for IPv6 and for IPv6
ipv6_addr=$(dig +short "$DOMAIN" aaaa)
ipv4_addr=$(dig +short "$DOMAIN" a)
if [ -z -z "$ipv6_addr" -a -z "$ipv4_addr" ]; then
echo "Resolving $DOMAIN failed, waiting 5 seconds before retrying ..."
sleep 5
else
echo "Resolved domain $DOMAIN: ipv6: $ipv6_addr ipv4: $ipv4_addr"
fi
done
if [ "$STAGING" = no ]; then
STAGING=""
else

Loading…
Cancel
Save