From 73c3900f7598bf7f7b93e1e70248c9785cb2ea0c Mon Sep 17 00:00:00 2001 From: Matthew Baggett <matthew@baggett.me> Date: Sun, 28 Jan 2024 09:20:45 +0100 Subject: [PATCH] Actually add healthcheck --- .github/workflows/mitm-proxy.yml | 7 ++++++- mitm-proxy/Dockerfile | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mitm-proxy.yml b/.github/workflows/mitm-proxy.yml index b3fad62..58c3548 100644 --- a/.github/workflows/mitm-proxy.yml +++ b/.github/workflows/mitm-proxy.yml @@ -20,6 +20,7 @@ jobs: name: "MITM proxy with Healthchecks" runs-on: ubuntu-latest strategy: + fail-fast: false max-parallel: 15 matrix: mitmproxy: @@ -69,7 +70,7 @@ jobs: uses: actions/checkout@v4 with: sparse-checkout: | - mitmproxy + mitm-proxy - name: "Setup: Login to Docker Hub" if: ${{ !env.ACT }} @@ -91,6 +92,10 @@ jobs: context: mitm-proxy build-contexts: | mitmproxy/mitmproxy=docker-image://mitmproxy/mitmproxy:${{ matrix.mitmproxy }} + build-args: | + MITMPROXY_VERSION=${{ matrix.mitmproxy }} + GIT_SHA=${{ github.sha }} + BUILD_DATE=${{ github.event.repository.pushed_at }} platforms: ${{ (!env.ACT && !(startsWith('6.',matrix.mitmproxy) || startsWith('5.', matrix.mitmproxy))) && 'linux/amd64,linux/arm64' || 'linux/amd64' }} pull: true push: true diff --git a/mitm-proxy/Dockerfile b/mitm-proxy/Dockerfile index c281e16..c872a0f 100644 --- a/mitm-proxy/Dockerfile +++ b/mitm-proxy/Dockerfile @@ -1,9 +1,17 @@ # From upstream redis # hadolint ignore=DL3007 FROM mitmproxy/mitmproxy +ARG BUILD_DATE +ARG GIT_SHA +ARG MITM_VERSION LABEL maintainer="Matthew Baggett <matthew@baggett.me>" \ - org.label-schema.vcs-url="https://github.com/benzine-framework/docker" \ - org.opencontainers.image.source="https://github.com/benzine-framework/docker" + org.opencontainers.image.source="https://github.com/benzine-framework/docker/mitm-proxy" \ + org.opencontainers.image.title="mitm-proxy with healthcheck" \ + org.opencontainers.image.created="${BUILD_DATE}" \ + org.opencontainers.image.version="${MITM_VERSION}" \ + org.opencontainers.image.revision="${GIT_SHA}" \ + org.opencontainers.image.vendor="Benzine" \ + org.opencontainers.image.authors="Matthew Baggett <matthew@baggett.me>" # Install curl # hadolint ignore=DL3018,DL4006 @@ -31,5 +39,5 @@ RUN os=$(grep "^ID=" < /etc/os-release | cut -f2 -d'=') && \ fi # Add healthcheck -#HEALTHCHECK --interval=30s --timeout=3s \ -# CMD redis-cli PING +HEALTHCHECK --interval=30s --timeout=3s \ + CMD curl -I -x http://localhost:8080 -k https://www.google.com || exit 1