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 }} diff --git a/Dockerfile b/Dockerfile index 677f27b..16a02ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,20 @@ -FROM rockylinux:9 +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 +RUN chown root:squid /etc/squid/squid.conf RUN chmod 0640 /etc/squid/squid.conf COPY entrypoint.sh /sbin/entrypoint.sh 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