mirror of
https://github.com/b4tman/docker-squid.git
synced 2025-06-16 12:14:22 +00:00
Compare commits
152 Commits
Author | SHA1 | Date | |
---|---|---|---|
bc1e2c287d | |||
8723ca0ca8
|
|||
89f53c9af2 | |||
883a36790a | |||
3ff6520eeb | |||
3877c77b6f | |||
eb2cea4f44 | |||
39e61037cb | |||
1e431e392b | |||
c75d1354aa | |||
000a827460 | |||
8dab59fee5 | |||
8669f6e1d5 | |||
0978b18b73 | |||
63cf1fc739 | |||
9aec6fae6a | |||
75b290de69 | |||
8aab792bc1 | |||
7ea8a5793f | |||
a3b674e1d5
|
|||
2bd55e0a98
|
|||
fb56ae5164 | |||
bb4a85b410 | |||
abfd29ad78
|
|||
16e644983a
|
|||
33429ba79f | |||
05d3fc71a7 | |||
19ecd62b08
|
|||
4eb3c96208
|
|||
c1b8ceee1c | |||
f504923719 | |||
12abc8228d | |||
3ceca4d5f2 | |||
0e54ff03de | |||
dd877b801a | |||
6db980e029 | |||
2420794090 | |||
7a1ebcb1ac | |||
93898b83e2 | |||
291ca028a1 | |||
0f8b8450c4 | |||
a9d2a11911 | |||
a9042a350a | |||
558b4f3518 | |||
b209dc2c5b | |||
20ba07b326 | |||
b077ec9b09 | |||
f35cfdf194 | |||
2a86036919
|
|||
2d0d3bd90c | |||
1d71370e48 | |||
e108ff41f6
|
|||
e7d7016018
|
|||
a89c6b2878 | |||
9f260deb7f | |||
94cc9e2244 | |||
83cd331a0b | |||
1e0e16e157 | |||
6b980db7c7 | |||
2d8a60d962 | |||
dabb437ea8 | |||
494e411d43 | |||
d91a5600a9 | |||
8781714110 | |||
083adc0c03 | |||
a1580af18a | |||
244937d517 | |||
4af565e3ae
|
|||
e4ff285091
|
|||
00f78a3728
|
|||
f8b9da006c
|
|||
0db0d2b19d
|
|||
23eacf4e57 | |||
0eeb0d164a | |||
729ca2fafa | |||
62546a8254 | |||
ae76d1174d | |||
9433d48c4f | |||
9e91e64ef6 | |||
1cc9b312f0 | |||
d54e44e377 | |||
9740438244 | |||
b57acfb9a4 | |||
bec4084981 | |||
c2e70b044d | |||
fcfa3b1c54 | |||
711d7a9857 | |||
68366aee74 | |||
12bcc8b563 | |||
551440b10b | |||
363e8fc3b3 | |||
70328d9317 | |||
4f4a317dd1 | |||
1a73d68725 | |||
3c252eeefc | |||
adaca5c8f6 | |||
7c96578aba | |||
18a19cf903 | |||
e80cef4c10 | |||
028f616481 | |||
cdc5ff74b5 | |||
d745475ec5 | |||
330ade1664 | |||
19a48fb8cb | |||
ae6037f2d7 | |||
2f0d4d2f76
|
|||
0fd6d1f258 | |||
178974b0df | |||
2eea5bc28f | |||
2ba626f10a | |||
f9e3532674 | |||
79c4b13210 | |||
b1a8f65fe3 | |||
02094e50e2 | |||
411b922800 | |||
92cf56c414 | |||
029f8e55aa | |||
3895aba33e | |||
685eeddf3e
|
|||
1075790c45
|
|||
2d2de740db | |||
9d7abf3dea
|
|||
3ce1d078b7
|
|||
b68f62c04c | |||
2e3e78056d
|
|||
9e6775a422
|
|||
4649add0df
|
|||
adc4f54b02 | |||
da817bec0d
|
|||
20bcc3ca7d
|
|||
93fe767842
|
|||
82d495d681
|
|||
e023bae64b
|
|||
024ff445bb
|
|||
0dcc835803 | |||
ba0d25813e
|
|||
f1c7c6796f | |||
0e581bd499 | |||
bc32b5d1da | |||
7e71d6c43b | |||
3d2e367c14 | |||
f5fbbb9034
|
|||
a56bf2890d | |||
88f5a067fb | |||
b90f70705c | |||
6eb782b5a6
|
|||
c3138cec07 | |||
d01a447dcf | |||
6486bd001c | |||
212bdefa3b | |||
824146b6c6 | |||
ab6974f7b7
|
@ -17,16 +17,20 @@ steps:
|
|||||||
username: b4tman
|
username: b4tman
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
|
config:
|
||||||
|
from_secret: docker_config
|
||||||
- name: squid-armhf image for github packages
|
- name: squid-armhf image for github packages
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
repo: docker.pkg.github.com/b4tman/docker-squid/squid-armhf
|
repo: ghcr.io/b4tman/squid-armhf
|
||||||
auto_tag: true
|
auto_tag: true
|
||||||
pull_image: true
|
pull_image: true
|
||||||
registry: docker.pkg.github.com
|
registry: ghcr.io
|
||||||
username: b4tman
|
username: b4tman
|
||||||
password:
|
password:
|
||||||
from_secret: github_password
|
from_secret: github_password
|
||||||
|
config:
|
||||||
|
from_secret: docker_config
|
||||||
trigger:
|
trigger:
|
||||||
ref:
|
ref:
|
||||||
- refs/tags/**
|
- refs/tags/**
|
||||||
|
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
custom: ['https://boosty.to/0xffff', 'https://www.donationalerts.com/r/b4tman1']
|
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@ -1,8 +1,14 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: docker
|
- package-ecosystem: docker
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: monthly
|
||||||
time: '02:00'
|
time: "02:00"
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
time: "03:00"
|
||||||
|
284
.github/workflows/dockerimage.yml
vendored
284
.github/workflows/dockerimage.yml
vendored
@ -5,79 +5,229 @@ on:
|
|||||||
# Publish `master` as Docker `latest` image.
|
# Publish `master` as Docker `latest` image.
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- v5
|
||||||
|
|
||||||
# Publish `v1.2.3` tags as releases.
|
# Publish `v1.2.3` tags as releases.
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
|
||||||
# Run tests for any PRs.
|
# Run tests for PRs to `master` branch.
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
|
||||||
|
env:
|
||||||
|
TEST_TAG: b4tman/squid:test
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build squid image
|
- name: Set up QEMU
|
||||||
run: docker build . --file Dockerfile --tag b4tman/squid
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Test image
|
- name: Set up Docker Buildx
|
||||||
run: docker-compose -f docker-compose.test.yml up sut
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build 'ssl-bump' image
|
- name: Login to DockerHub
|
||||||
run: docker build ssl-bump --tag b4tman/squid:ssl-bump
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: b4tman
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v4.2.3
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
- name: Build squid image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: false
|
||||||
|
load: true # automatically load the single-platform build result to docker images
|
||||||
|
tags: ${{ env.TEST_TAG }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||||
|
|
||||||
|
# Temp fix
|
||||||
|
# https://github.com/docker/build-push-action/issues/252
|
||||||
|
# https://github.com/moby/buildkit/issues/1896
|
||||||
|
- name: Move cache
|
||||||
|
run: |
|
||||||
|
rm -rf /tmp/.buildx-cache
|
||||||
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Test image
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
docker compose -f docker-compose.test.yml up --pull never sut --exit-code-from sut
|
||||||
|
docker compose -f docker-compose.test.yml down
|
||||||
|
|
||||||
|
- name: set base image for 'ssl-bump'
|
||||||
|
run: |
|
||||||
|
sed -i "s%FROM b4tman/squid%FROM $TEST_TAG%" ssl-bump/Dockerfile
|
||||||
|
|
||||||
|
- name: Build 'ssl-bump' image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: false
|
||||||
|
load: true
|
||||||
|
tags: ${{ env.TEST_TAG }}-ssl-bump
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||||
|
|
||||||
|
# Temp fix
|
||||||
|
# https://github.com/docker/build-push-action/issues/252
|
||||||
|
# https://github.com/moby/buildkit/issues/1896
|
||||||
|
- name: Move cache
|
||||||
|
run: |
|
||||||
|
rm -rf /tmp/.buildx-cache
|
||||||
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Test 'ssl-bump' image
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
TEST_TAG="${TEST_TAG}-ssl-bump" docker compose -f docker-compose.test.yml up --pull never sut --exit-code-from sut
|
||||||
|
docker compose -f docker-compose.test.yml down
|
||||||
push:
|
push:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push'
|
if: github.event_name != 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build squid image
|
- name: Docker meta
|
||||||
run: docker build . --file Dockerfile --tag b4tman/squid
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
- name: Build 'ssl-bump' image
|
with:
|
||||||
run: docker build ssl-bump --tag b4tman/squid:ssl-bump
|
images: |
|
||||||
|
b4tman/squid
|
||||||
- name: Log into registry
|
ghcr.io/b4tman/squid
|
||||||
run: echo "${{ secrets.GITHUB_PKGS_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
flavor: |
|
||||||
|
latest=${{ github.ref == 'refs/heads/master' }}
|
||||||
- name: Push squid image
|
tags: |
|
||||||
run: |
|
type=ref,event=branch
|
||||||
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/squid
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
# Strip git ref prefix from version
|
|
||||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
- name: Docker meta (ssl-bump)
|
||||||
|
id: meta_ssl_bump
|
||||||
# Strip "v" prefix from tag name
|
uses: docker/metadata-action@v5
|
||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
with:
|
||||||
|
images: |
|
||||||
# Use Docker `latest` tag convention
|
b4tman/squid
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest
|
ghcr.io/b4tman/squid
|
||||||
|
flavor: |
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
latest=false
|
||||||
echo VERSION=$VERSION
|
suffix=-ssl-bump
|
||||||
|
tags: |
|
||||||
docker tag b4tman/squid $IMAGE_ID:$VERSION
|
type=ref,event=branch
|
||||||
docker push $IMAGE_ID:$VERSION
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
- name: Push 'ssl-bump' image
|
|
||||||
run: |
|
- name: Docker meta (ssl-bump ghcr)
|
||||||
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/ssl-bump
|
id: meta_ssl_bump_ghcr
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
# Strip git ref prefix from version
|
with:
|
||||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
images: |
|
||||||
|
ghcr.io/b4tman/squid-ssl-bump
|
||||||
# Strip "v" prefix from tag name
|
flavor: |
|
||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
latest=${{ github.ref == 'refs/heads/master' }}
|
||||||
|
tags: |
|
||||||
# Use Docker `latest` tag convention
|
type=ref,event=branch
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
|
||||||
echo VERSION=$VERSION
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
docker tag b4tman/squid:ssl-bump $IMAGE_ID:$VERSION
|
|
||||||
docker push $IMAGE_ID:$VERSION
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v4.2.3
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: b4tman
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.CR_PAT }}
|
||||||
|
|
||||||
|
- name: Build squid image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm/v7
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||||
|
|
||||||
|
# Temp fix
|
||||||
|
# https://github.com/docker/build-push-action/issues/252
|
||||||
|
# https://github.com/moby/buildkit/issues/1896
|
||||||
|
- name: Move cache
|
||||||
|
run: |
|
||||||
|
rm -rf /tmp/.buildx-cache
|
||||||
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Build 'ssl-bump' image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ssl-bump
|
||||||
|
push: true
|
||||||
|
file: ssl-bump/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm/v7
|
||||||
|
tags: ${{ steps.meta_ssl_bump.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta_ssl_bump.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||||
|
|
||||||
|
# Temp fix
|
||||||
|
# https://github.com/docker/build-push-action/issues/252
|
||||||
|
# https://github.com/moby/buildkit/issues/1896
|
||||||
|
- name: Move cache
|
||||||
|
run: |
|
||||||
|
rm -rf /tmp/.buildx-cache
|
||||||
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||||
|
|
||||||
|
- name: Build 'ssl-bump' image for ghcr
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ssl-bump
|
||||||
|
push: true
|
||||||
|
file: ssl-bump/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm/v7
|
||||||
|
tags: ${{ steps.meta_ssl_bump_ghcr.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta_ssl_bump_ghcr.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||||
|
|
||||||
|
# Temp fix
|
||||||
|
# https://github.com/docker/build-push-action/issues/252
|
||||||
|
# https://github.com/moby/buildkit/issues/1896
|
||||||
|
- name: Move cache
|
||||||
|
run: |
|
||||||
|
rm -rf /tmp/.buildx-cache
|
||||||
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||||
|
28
.github/workflows/stale.yml
vendored
Normal file
28
.github/workflows/stale.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||||
|
#
|
||||||
|
# You can adjust the behavior by modifying this file.
|
||||||
|
# For more information, see:
|
||||||
|
# https://github.com/actions/stale
|
||||||
|
name: Mark stale issues and pull requests
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 1 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v9
|
||||||
|
with:
|
||||||
|
days-before-stale: 182
|
||||||
|
days-before-close: 7
|
||||||
|
stale-issue-message: 'Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days.'
|
||||||
|
close-issue-message: 'Closing due to inactivity.'
|
||||||
|
stale-pr-message: 'Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days.'
|
||||||
|
close-pr-message: 'Closing due to inactivity.'
|
88
Dockerfile
88
Dockerfile
@ -1,7 +1,6 @@
|
|||||||
FROM alpine:3.12.0 as build
|
FROM alpine:3.22.0 as build
|
||||||
|
|
||||||
ENV SQUID_VER 4.13
|
ARG SQUID_VER=6.13
|
||||||
ENV SQUID_SIG_KEY B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E
|
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
@ -10,7 +9,8 @@ RUN set -x && \
|
|||||||
libc-dev \
|
libc-dev \
|
||||||
curl \
|
curl \
|
||||||
gnupg \
|
gnupg \
|
||||||
libressl-dev \
|
openssl-dev \
|
||||||
|
openssl-libs-static \
|
||||||
perl-dev \
|
perl-dev \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
@ -21,34 +21,33 @@ RUN set -x && \
|
|||||||
libcap-dev \
|
libcap-dev \
|
||||||
linux-headers
|
linux-headers
|
||||||
|
|
||||||
|
WORKDIR /tmp/build
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
mkdir -p /tmp/build && \
|
curl -fSsL "https://github.com/squid-cache/squid/releases/download/SQUID_${SQUID_VER//./_}/squid-${SQUID_VER}.tar.gz" -o squid-${SQUID_VER}.tar.gz && \
|
||||||
cd /tmp/build && \
|
curl -fSsL "https://github.com/squid-cache/squid/releases/download/SQUID_${SQUID_VER//./_}/squid-${SQUID_VER}.tar.gz.asc" -o squid-${SQUID_VER}.tar.gz.asc
|
||||||
curl -SsL http://www.squid-cache.org/Versions/v${SQUID_VER%%.*}/squid-${SQUID_VER}.tar.gz -o squid-${SQUID_VER}.tar.gz && \
|
|
||||||
curl -SsL http://www.squid-cache.org/Versions/v${SQUID_VER%%.*}/squid-${SQUID_VER}.tar.gz.asc -o squid-${SQUID_VER}.tar.gz.asc
|
COPY squid-keys.asc /tmp/build
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
cd /tmp/build && \
|
GNUPGHOME="$(mktemp -d)" && \
|
||||||
export GNUPGHOME="$(mktemp -d)" && \
|
export GNUPGHOME && \
|
||||||
( \
|
gpg --import squid-keys.asc && \
|
||||||
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys ${SQUID_SIG_KEY} || \
|
|
||||||
gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys ${SQUID_SIG_KEY} || \
|
|
||||||
gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys ${SQUID_SIG_KEY} \
|
|
||||||
) && \
|
|
||||||
gpg --batch --verify squid-${SQUID_VER}.tar.gz.asc squid-${SQUID_VER}.tar.gz && \
|
gpg --batch --verify squid-${SQUID_VER}.tar.gz.asc squid-${SQUID_VER}.tar.gz && \
|
||||||
rm -rf "$GNUPGHOME"
|
rm -rf "$GNUPGHOME"
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
cd /tmp/build && \
|
|
||||||
tar --strip 1 -xzf squid-${SQUID_VER}.tar.gz && \
|
tar --strip 1 -xzf squid-${SQUID_VER}.tar.gz && \
|
||||||
\
|
\
|
||||||
|
MACHINE=$(uname -m) && \
|
||||||
|
\
|
||||||
CFLAGS="-g0 -O2" \
|
CFLAGS="-g0 -O2" \
|
||||||
CXXFLAGS="-g0 -O2" \
|
CXXFLAGS="-g0 -O2" \
|
||||||
LDFLAGS="-s" \
|
LDFLAGS="-s" \
|
||||||
\
|
\
|
||||||
./configure \
|
./configure \
|
||||||
--build="$(uname -m)" \
|
--build="$MACHINE" \
|
||||||
--host="$(uname -m)" \
|
--host="$MACHINE" \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--datadir=/usr/share/squid \
|
--datadir=/usr/share/squid \
|
||||||
--sysconfdir=/etc/squid \
|
--sysconfdir=/etc/squid \
|
||||||
@ -59,7 +58,8 @@ RUN set -x && \
|
|||||||
--disable-arch-native \
|
--disable-arch-native \
|
||||||
--enable-removal-policies="lru,heap" \
|
--enable-removal-policies="lru,heap" \
|
||||||
--enable-auth-digest \
|
--enable-auth-digest \
|
||||||
--enable-auth-basic="getpwnam,NCSA" \
|
--enable-auth-basic="getpwnam,NCSA,DB,RADIUS" \
|
||||||
|
--enable-basic-auth-helpers="DB" \
|
||||||
--enable-epoll \
|
--enable-epoll \
|
||||||
--enable-external-acl-helpers="file_userip,unix_group,wbinfo_group" \
|
--enable-external-acl-helpers="file_userip,unix_group,wbinfo_group" \
|
||||||
--enable-auth-ntlm="fake" \
|
--enable-auth-ntlm="fake" \
|
||||||
@ -86,7 +86,7 @@ RUN set -x && \
|
|||||||
--enable-storeio="diskd rock" \
|
--enable-storeio="diskd rock" \
|
||||||
--enable-ipv6 \
|
--enable-ipv6 \
|
||||||
--enable-translation \
|
--enable-translation \
|
||||||
--disable-snmp \
|
--enable-snmp \
|
||||||
--disable-dependency-tracking \
|
--disable-dependency-tracking \
|
||||||
--with-large-files \
|
--with-large-files \
|
||||||
--with-default-user=squid \
|
--with-default-user=squid \
|
||||||
@ -94,15 +94,19 @@ RUN set -x && \
|
|||||||
--with-pidfile=/var/run/squid/squid.pid
|
--with-pidfile=/var/run/squid/squid.pid
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
cd /tmp/build && \
|
nproc=$(n=$(nproc) ; max_n=6 ; echo $(( n <= max_n ? n : max_n )) ) && \
|
||||||
nproc=$(n=$(nproc) ; max_n=6 ; [ $n -le $max_n ] && echo $n || echo $max_n) && \
|
|
||||||
make -j $nproc && \
|
make -j $nproc && \
|
||||||
make install
|
make install
|
||||||
|
|
||||||
RUN sed -i '1s;^;include /etc/squid/conf.d/*.conf\n;' /etc/squid/squid.conf
|
|
||||||
RUN echo 'include /etc/squid/conf.d.tail/*.conf' >> /etc/squid/squid.conf
|
|
||||||
|
|
||||||
FROM alpine:3.12.0
|
WORKDIR /tmp/build/tools/squidclient
|
||||||
|
RUN make && make install-strip
|
||||||
|
|
||||||
|
RUN sed -i '1s;^;include /etc/squid/conf.d/*.conf\n;' /etc/squid/squid.conf && \
|
||||||
|
echo 'include /etc/squid/conf.d.tail/*.conf' >> /etc/squid/squid.conf
|
||||||
|
|
||||||
|
# --- --- --- --- --- --- --- --- ---
|
||||||
|
|
||||||
|
FROM alpine:3.22.0
|
||||||
|
|
||||||
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
|
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
|
||||||
ENV TZ Europe/Moscow
|
ENV TZ Europe/Moscow
|
||||||
@ -115,35 +119,31 @@ RUN apk add --no-cache \
|
|||||||
libstdc++ \
|
libstdc++ \
|
||||||
heimdal-libs \
|
heimdal-libs \
|
||||||
libcap \
|
libcap \
|
||||||
libressl3.1-libcrypto \
|
libltdl \
|
||||||
libressl3.1-libssl \
|
tzdata
|
||||||
libltdl
|
|
||||||
|
|
||||||
COPY --from=build /etc/squid/ /etc/squid/
|
COPY --from=build /etc/squid/ /etc/squid/
|
||||||
COPY --from=build /usr/lib/squid/ /usr/lib/squid/
|
COPY --from=build /usr/lib/squid/ /usr/lib/squid/
|
||||||
COPY --from=build /usr/share/squid/ /usr/share/squid/
|
COPY --from=build /usr/share/squid/ /usr/share/squid/
|
||||||
COPY --from=build /usr/sbin/squid /usr/sbin/squid
|
COPY --from=build /usr/sbin/squid /usr/sbin/squid
|
||||||
|
COPY --from=build /usr/bin/squidclient /usr/bin/squidclient
|
||||||
|
|
||||||
|
COPY --chmod=755 run.sh /
|
||||||
|
|
||||||
RUN install -d -o squid -g squid \
|
RUN install -d -o squid -g squid \
|
||||||
/var/cache/squid \
|
/var/cache/squid \
|
||||||
/var/log/squid \
|
/var/log/squid \
|
||||||
/var/run/squid && \
|
/var/run/squid && \
|
||||||
chmod +x /usr/lib/squid/*
|
chmod +x /usr/lib/squid/* && \
|
||||||
|
install -d -m 755 -o squid -g squid \
|
||||||
RUN install -d -m 755 -o squid -g squid \
|
|
||||||
/etc/squid/conf.d \
|
/etc/squid/conf.d \
|
||||||
/etc/squid/conf.d.tail
|
/etc/squid/conf.d.tail && \
|
||||||
RUN touch /etc/squid/conf.d/placeholder.conf
|
touch /etc/squid/conf.d/placeholder.conf
|
||||||
COPY squid-log.conf /etc/squid/conf.d.tail/
|
COPY squid-log.conf /etc/squid/conf.d.tail/
|
||||||
|
|
||||||
RUN set -x && \
|
VOLUME ["/var/cache/squid"]
|
||||||
apk add --no-cache --virtual .tz alpine-conf tzdata && \
|
|
||||||
/sbin/setup-timezone -z $TZ && \
|
|
||||||
apk del .tz
|
|
||||||
|
|
||||||
VOLUME ["/var/cache/squid"]
|
|
||||||
EXPOSE 3128/tcp
|
EXPOSE 3128/tcp
|
||||||
|
|
||||||
USER squid
|
USER squid
|
||||||
|
|
||||||
CMD ["sh", "-c", "/usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -YCd 1"]
|
CMD ["/run.sh"]
|
||||||
|
14
README.md
14
README.md
@ -1,12 +1,17 @@
|
|||||||
[](https://cloud.drone.io/b4tman/docker-squid)
|
|
||||||

|
|
||||||

|

|
||||||
|
|
||||||
# docker-squid
|
# docker-squid
|
||||||
|
|
||||||
Docker Squid container based on Alpine Linux.
|
Docker Squid container based on Alpine Linux.
|
||||||
|
|
||||||
Automated builds of the image are available on [Dockerhub](https://hub.docker.com/r/b4tman/squid).
|
Automated builds of the image are available on:
|
||||||
|
|
||||||
|
- DockerHub:
|
||||||
|
- [b4tman/squid](https://hub.docker.com/r/b4tman/squid)
|
||||||
|
- Github:
|
||||||
|
- [ghcr.io/b4tman/squid](https://github.com/users/b4tman/packages/container/package/squid)
|
||||||
|
- [ghcr.io/b4tman/squid-armhf](https://github.com/users/b4tman/packages/container/package/squid-armhf)
|
||||||
|
- [ghcr.io/b4tman/squid-ssl-bump](https://github.com/users/b4tman/packages/container/package/squid-ssl-bump)
|
||||||
|
|
||||||
# Quick Start
|
# Quick Start
|
||||||
|
|
||||||
@ -29,7 +34,6 @@ docker-compose up
|
|||||||
|
|
||||||
- **SQUID_CONFIG_FILE**: Specify the configuration file for squid. Defaults to `/etc/squid/squid.conf`.
|
- **SQUID_CONFIG_FILE**: Specify the configuration file for squid. Defaults to `/etc/squid/squid.conf`.
|
||||||
|
|
||||||
|
|
||||||
## Example:
|
## Example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -39,4 +43,4 @@ docker run -p 3128:3128 \
|
|||||||
b4tman/squid
|
b4tman/squid
|
||||||
```
|
```
|
||||||
|
|
||||||
This will start a squid container with your config file `/srv/docker/squid/squid.conf`.
|
This will start a squid container with your config file `/srv/docker/squid/squid.conf`.
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
version: '2'
|
version: '2.3'
|
||||||
services:
|
services:
|
||||||
proxy:
|
proxy:
|
||||||
build: .
|
image: "${TEST_TAG}"
|
||||||
|
volumes:
|
||||||
|
- './test_localnet.conf:/etc/squid/conf.d/test_localnet.conf:ro'
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "sh", "-exc", "squidclient -T 3 mgr:info 2> /dev/null | grep -qF '200 OK'"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 5
|
||||||
|
start_period: 1s
|
||||||
sut:
|
sut:
|
||||||
image: alpine:3.10.1
|
image: "${TEST_TAG}"
|
||||||
links:
|
links:
|
||||||
- proxy
|
- proxy
|
||||||
depends_on:
|
depends_on:
|
||||||
- proxy
|
- proxy
|
||||||
command: sh -exc "apk add --update curl && sleep 5 && exec curl --proxy http://proxy:3128 -I http://google.com/"
|
command: sh -exc "sleep 10 && squidclient -h proxy -T 3 'https://postman-echo.com/get?squidtest=ok' 2> /dev/null | grep -qF '200 OK'"
|
||||||
|
|
||||||
|
14
run.sh
Normal file
14
run.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# force remove pid
|
||||||
|
if [ -e /var/run/squid/squid.pid ]; then
|
||||||
|
rm -f /var/run/squid/squid.pid
|
||||||
|
fi
|
||||||
|
|
||||||
|
# init cache
|
||||||
|
/usr/sbin/squid -f "${SQUID_CONFIG_FILE}" --foreground -z
|
||||||
|
|
||||||
|
# run squid
|
||||||
|
exec /usr/sbin/squid -f "${SQUID_CONFIG_FILE}" --foreground -YCd 1
|
2067
squid-keys.asc
Normal file
2067
squid-keys.asc
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,9 @@
|
|||||||
FROM b4tman/squid
|
FROM b4tman/squid
|
||||||
|
|
||||||
|
COPY run.sh /
|
||||||
USER root
|
USER root
|
||||||
CMD ["sh", "-c", "(test -d /var/cache/squid/ssl_db || /usr/lib/squid/security_file_certgen -c -s /var/cache/squid/ssl_db -M 4MB) && /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -YCd 1"]
|
RUN chmod 755 /run.sh
|
||||||
|
|
||||||
|
USER squid
|
||||||
|
|
||||||
|
CMD ["/run.sh"]
|
||||||
|
14
ssl-bump/run.sh
Normal file
14
ssl-bump/run.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# init ssl_db
|
||||||
|
if [ ! -d /var/cache/squid/ssl_db ]; then
|
||||||
|
/usr/lib/squid/security_file_certgen -c -s /var/cache/squid/ssl_db -M 4MB
|
||||||
|
fi
|
||||||
|
|
||||||
|
# init cache
|
||||||
|
/usr/sbin/squid -f "${SQUID_CONFIG_FILE}" --foreground -z
|
||||||
|
|
||||||
|
# run squid
|
||||||
|
exec /usr/sbin/squid -f "${SQUID_CONFIG_FILE}" --foreground -YCd 1
|
11
test_localnet.conf
Normal file
11
test_localnet.conf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
acl localnet1 src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
|
||||||
|
acl localnet1 src 10.0.0.0/8 # RFC 1918 local private network (LAN)
|
||||||
|
acl localnet1 src 100.64.0.0/10 # RFC 6598 shared address space (CGN)
|
||||||
|
acl localnet1 src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines
|
||||||
|
acl localnet1 src 172.16.0.0/12 # RFC 1918 local private network (LAN)
|
||||||
|
acl localnet1 src 192.168.0.0/16 # RFC 1918 local private network (LAN)
|
||||||
|
acl localnet1 src fc00::/7 # RFC 4193 local private network range
|
||||||
|
acl localnet1 src fe80::/10 # RFC 4291 link-local (directly plugged) machines
|
||||||
|
|
||||||
|
http_access allow localnet1
|
||||||
|
http_access allow localhost manager
|
Reference in New Issue
Block a user