Skip to content

Commit

Permalink
unbound: remove netcat check & package
Browse files Browse the repository at this point in the history
  • Loading branch information
DerLinkman committed Feb 8, 2024
1 parent e184713 commit 63426c3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
3 changes: 1 addition & 2 deletions data/Dockerfiles/unbound/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ LABEL maintainer "The Infrastructure Company GmbH GmbH <[email protected]>"
RUN apk add --update --no-cache \
curl \
bind-tools \
netcat-openbsd \
unbound \
bash \
openssl \
Expand All @@ -20,7 +19,7 @@ EXPOSE 53/udp 53/tcp

COPY docker-entrypoint.sh /docker-entrypoint.sh

# healthcheck (dig, ping, nc)
# healthcheck (dig, ping)
COPY healthcheck.sh /healthcheck.sh
RUN chmod +x /healthcheck.sh
HEALTHCHECK --interval=30s --timeout=30s CMD [ "/healthcheck.sh" ]
Expand Down
27 changes: 0 additions & 27 deletions data/Dockerfiles/unbound/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,6 @@ function check_dns() {

}

# Simple Netcat Check to connect to common webports
function check_netcat() {
declare -a domains=("mailcow.email" "github.com" "hub.docker.com")
declare -a ports=("80" "443")

for domain in "${domains[@]}" ; do
for port in "${ports[@]}" ; do
nc -z -w 2 $domain $port
if [ $? -ne 0 ]; then
log_to_file "Healthcheck: Could not reach $domain on Port $port... Gave up!"
log_to_file "Please check your internet connection or firewall rules to fix this error."
return 1
fi
done
done

log_to_file "Healthcheck: Netcat Checks WORKING properly!"
return 0

}

if [[ ${SKIP_UNBOUND_HEALTHCHECK} == "y" ]]; then
log_to_file "Healthcheck: ALL CHECKS WERE SKIPPED! Unbound is healthy!"
exit 0
Expand All @@ -89,11 +68,5 @@ if [ $? -ne 0 ]; then
exit 1
fi

check_netcat

if [ $? -ne 0 ]; then
exit 1
fi

log_to_file "Healthcheck: ALL CHECKS WERE SUCCESSFUL! Unbound is healthy!"
exit 0

0 comments on commit 63426c3

Please sign in to comment.