Skip to content

Commit

Permalink
Chore: Fixed Docker Health Check (#2659)
Browse files Browse the repository at this point in the history
* docker_healthcheck_fix

* grep_fix_for_alpine

* added environment variable for healthcheck and changed the port extraction accorfingly
  • Loading branch information
manojks1999 authored Mar 4, 2024
1 parent 842249b commit 0081f4d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tools/docker/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/sh

HOST="localhost"
PORT=6379
PORT=$HEALTHCHECK_PORT

if [ -z "$HEALTHCHECK_PORT" ]; then
PORT=$(netstat -tuln | grep -oE ':[0-9]+' | grep -oE '[0-9]+' | tail -n 1)
fi

# If we're running with TLS enabled, utilise OpenSSL for the check
if [ -f "/etc/dragonfly/tls/ca.crt" ]
Expand Down
2 changes: 1 addition & 1 deletion tools/packaging/Dockerfile.alpine-dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM gcr.io/cadvisor/cadvisor:v0.46.0 as libpfm_donor
FROM alpine:3 as builder

# "openssl-libs-static" fixes "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the"
RUN apk add autoconf-archive automake bash bison boost-dev cmake coreutils \
RUN apk add autoconf-archive automake bash bison boost-dev cmake coreutils net-tools \
curl ccache git gcc gdb g++ libunwind-dev libtool make ninja \
openssl-dev openssl-libs-static patch zip zstd-static

Expand Down
2 changes: 1 addition & 1 deletion tools/packaging/Dockerfile.ubuntu-dev
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM ubuntu:20.04
RUN --mount=type=tmpfs,target=/var/cache/apt \
--mount=type=tmpfs,target=/var/lib/apt/lists \
apt update && \
apt install -q -y --no-install-recommends netcat-openbsd ca-certificates redis-tools
apt install -q -y --no-install-recommends netcat-openbsd ca-certificates redis-tools net-tools

RUN groupadd -r -g 999 dfly && useradd -r -g dfly -u 999 dfly
RUN mkdir /data && chown dfly:dfly /data
Expand Down
2 changes: 1 addition & 1 deletion tools/packaging/Dockerfile.ubuntu-prod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN --mount=type=tmpfs,target=/var/cache/apt \
--mount=type=tmpfs,target=/var/lib/apt/lists \
apt -q update && \
apt install -q -y --no-install-recommends netcat-openbsd ca-certificates redis-tools
apt install -q -y --no-install-recommends netcat-openbsd ca-certificates redis-tools net-tools

RUN groupadd -r -g 999 dfly && useradd -r -g dfly -u 999 dfly
RUN mkdir /data && chown dfly:dfly /data
Expand Down

0 comments on commit 0081f4d

Please sign in to comment.