NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

unbound: remove netcat check & package

63426c3c
DerLinkman <[email protected]> 2 years, 5 months ago
data/Dockerfiles/unbound/Dockerfile     |  3 +--
 data/Dockerfiles/unbound/healthcheck.sh | 27 ---------------------------
 2 files changed, 1 insertion(+), 29 deletions(-)

Diff

diff --git a/data/Dockerfiles/unbound/Dockerfile b/data/Dockerfiles/unbound/Dockerfile
index f6d072cc..3090895b 100644
--- a/data/Dockerfiles/unbound/Dockerfile
+++ b/data/Dockerfiles/unbound/Dockerfile
@@ -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 \
@@ -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" ]
diff --git a/data/Dockerfiles/unbound/healthcheck.sh b/data/Dockerfiles/unbound/healthcheck.sh
index a96eaab4..8da79bd7 100644
--- a/data/Dockerfiles/unbound/healthcheck.sh
+++ b/data/Dockerfiles/unbound/healthcheck.sh
@@ -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
@@ -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
\ No newline at end of file