From 95408285f92bf351f48e24449aabce83c80f9970 Mon Sep 17 00:00:00 2001 From: Matt Anson Date: Tue, 10 Mar 2026 13:21:59 +0000 Subject: [PATCH 1/5] Use rockylinux:10 baseimage --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 677f27b..2be0760 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rockylinux:9 +FROM quay.io/rockylinux/rockylinux:10 LABEL maintainer=StackHPC ENV SQUID_VERSION=5.5 \ From dde9da38970bab862992e63dd3d60763045c0f86 Mon Sep 17 00:00:00 2001 From: Matt Anson Date: Tue, 10 Mar 2026 13:23:31 +0000 Subject: [PATCH 2/5] Update syntax for chown squid.conf --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2be0760..e6a844a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN dnf install -y \ squid-${SQUID_VERSION} COPY squid.conf /etc/squid/squid.conf -RUN chown root.squid /etc/squid/squid.conf +RUN chown root:squid /etc/squid/squid.conf RUN chmod 0640 /etc/squid/squid.conf COPY entrypoint.sh /sbin/entrypoint.sh From 7407b436de317b86357feb6ac948a1c069402a43 Mon Sep 17 00:00:00 2001 From: Matt Anson Date: Tue, 10 Mar 2026 13:23:54 +0000 Subject: [PATCH 3/5] Allow SQUID_VERSION to be passed as a build-arg --- Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6a844a..16a02ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,17 @@ FROM quay.io/rockylinux/rockylinux:10 LABEL maintainer=StackHPC -ENV SQUID_VERSION=5.5 \ - SQUID_CACHE_DIR=/var/spool/squid \ +ARG SQUID_VERSION="" + +ENV SQUID_CACHE_DIR=/var/spool/squid \ SQUID_LOG_DIR=/var/log/squid \ SQUID_USER=squid -RUN dnf install -y \ - which \ - squid-${SQUID_VERSION} +RUN if [[ -z "${SQUID_VERSION}" ]]; then \ + dnf install -y which squid; \ + else \ + dnf install -y which squid-${SQUID_VERSION}; \ + fi COPY squid.conf /etc/squid/squid.conf RUN chown root:squid /etc/squid/squid.conf From 1da565f491f706bca9fa8209f3c24df1412d81c6 Mon Sep 17 00:00:00 2001 From: Matt Anson Date: Tue, 10 Mar 2026 13:24:11 +0000 Subject: [PATCH 4/5] Log squid access to stdout --- squid.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/squid.conf b/squid.conf index 24a289d..a6feaac 100644 --- a/squid.conf +++ b/squid.conf @@ -73,3 +73,6 @@ refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern . 0 20% 4320 + +# Redirect access logs to stdout +access_log stdio:/dev/stdout squid From e24d8c1340c7f97ecbf8f87297f73f9074e8e8aa Mon Sep 17 00:00:00 2001 From: Matt Anson Date: Tue, 10 Mar 2026 13:24:45 +0000 Subject: [PATCH 5/5] Update CI workflow to set image tag to squid version --- .github/workflows/build-and-push-images.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-push-images.yaml b/.github/workflows/build-and-push-images.yaml index 0f4520c..2094973 100644 --- a/.github/workflows/build-and-push-images.yaml +++ b/.github/workflows/build-and-push-images.yaml @@ -47,9 +47,11 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - name: Build and push Docker image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v7 with: context: . + build-args: | + SQUID_VERSION=${{ github.ref_type == 'tag' && github.ref_name || '' }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}