mirror of
https://github.com/b4tman/docker-squid.git
synced 2025-09-02 15:37:30 +00:00
Compare commits
39 Commits
v6.7.0
...
armhf-cros
Author | SHA1 | Date | |
---|---|---|---|
9dab1b00cf
|
|||
20ef8cf8be
|
|||
9d46731628
|
|||
323e4533e7
|
|||
aabc247a2b
|
|||
9f6c88ad96
|
|||
a83166d95e
|
|||
d040773634
|
|||
b5e86101ef
|
|||
e3a188f419
|
|||
f37e4a4dfd
|
|||
158d177c51
|
|||
2bd558e146
|
|||
63c7ba99e9
|
|||
7ac8996e39
|
|||
d92da9a79d
|
|||
11434c9296
|
|||
9e51552e39
|
|||
2c911aad44
|
|||
27509b05f6
|
|||
6f138189ff
|
|||
2c8641472e
|
|||
be6513f835
|
|||
b5974723e8
|
|||
f2f586f586
|
|||
0ba2814cd6
|
|||
382a181d1a
|
|||
9315ec46b5
|
|||
a68a4dc255
|
|||
8e5308aadf
|
|||
6f612170e6
|
|||
9d4c361f88 | |||
80bc95d75b | |||
876c6f0678 | |||
cab0b65ef3 | |||
f384c90781 | |||
266a711b36 | |||
7f55a91c1d | |||
247d11d625 |
37
.drone.yml
37
.drone.yml
@@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: arm32 images
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm
|
|
||||||
steps:
|
|
||||||
- name: squid image for dockerhub
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
repo: docker.io/b4tman/squid
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: armhf
|
|
||||||
pull_image: true
|
|
||||||
registry: docker.io
|
|
||||||
username: b4tman
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
config:
|
|
||||||
from_secret: docker_config
|
|
||||||
- name: squid-armhf image for github packages
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
repo: ghcr.io/b4tman/squid-armhf
|
|
||||||
auto_tag: true
|
|
||||||
pull_image: true
|
|
||||||
registry: ghcr.io
|
|
||||||
username: b4tman
|
|
||||||
password:
|
|
||||||
from_secret: github_password
|
|
||||||
config:
|
|
||||||
from_secret: docker_config
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/heads/master
|
|
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@@ -1,14 +1,8 @@
|
|||||||
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"
|
|
||||||
|
315
.github/workflows/dockerimage.yml
vendored
315
.github/workflows/dockerimage.yml
vendored
@@ -1,233 +1,84 @@
|
|||||||
name: Docker Image CI
|
name: Docker Image CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# Publish `master` as Docker `latest` image.
|
# Publish `master` as Docker `latest` image.
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- v5
|
- armhf-cross
|
||||||
|
|
||||||
# Publish `v1.2.3` tags as releases.
|
# Publish `v1.2.3` tags as releases.
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
|
||||||
# Run tests for PRs to `master` branch.
|
# Run tests for any PRs.
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- "master"
|
jobs:
|
||||||
|
test:
|
||||||
env:
|
runs-on: ubuntu-18.04
|
||||||
TEST_TAG: b4tman/squid:test
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
jobs:
|
|
||||||
test:
|
- name: Build squid image
|
||||||
runs-on: ubuntu-20.04
|
run: docker build . --file Dockerfile --tag b4tman/squid
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
- name: Test image
|
||||||
|
run: docker-compose -f docker-compose.test.yml up sut
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
- name: Build 'ssl-bump' image
|
||||||
|
run: docker build ssl-bump --tag b4tman/squid:ssl-bump
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
push:
|
||||||
|
needs: test
|
||||||
- name: Login to DockerHub
|
runs-on: ubuntu-18.04
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name == 'push'
|
||||||
uses: docker/login-action@v3
|
steps:
|
||||||
with:
|
- uses: actions/checkout@v2
|
||||||
username: b4tman
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
- name: Build squid image
|
||||||
|
run: docker build . --file Dockerfile --tag b4tman/squid
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v4.0.0
|
- name: Build 'ssl-bump' image
|
||||||
with:
|
run: docker build ssl-bump --tag b4tman/squid:ssl-bump
|
||||||
path: /tmp/.buildx-cache
|
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
- name: Log into registry
|
||||||
restore-keys: |
|
run: echo "${{ secrets.GITHUB_PKGS_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
||||||
${{ runner.os }}-buildx-
|
|
||||||
|
- name: Push squid image
|
||||||
- name: Build squid image
|
run: |
|
||||||
uses: docker/build-push-action@v5
|
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/squid
|
||||||
with:
|
|
||||||
context: .
|
# Strip git ref prefix from version
|
||||||
push: false
|
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
||||||
load: true # automatically load the single-platform build result to docker images
|
|
||||||
tags: ${{ env.TEST_TAG }}
|
# Strip "v" prefix from tag name
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
|
||||||
|
# Use Docker `latest` tag convention
|
||||||
# Temp fix
|
[ "$VERSION" == "master" ] && VERSION=latest
|
||||||
# https://github.com/docker/build-push-action/issues/252
|
|
||||||
# https://github.com/moby/buildkit/issues/1896
|
echo IMAGE_ID=$IMAGE_ID
|
||||||
- name: Move cache
|
echo VERSION=$VERSION
|
||||||
run: |
|
|
||||||
rm -rf /tmp/.buildx-cache
|
docker tag b4tman/squid $IMAGE_ID:$VERSION
|
||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
docker push $IMAGE_ID:$VERSION
|
||||||
|
|
||||||
- name: Test image
|
- name: Push 'ssl-bump' image
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/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
|
# Strip git ref prefix from version
|
||||||
|
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
||||||
- name: set base image for 'ssl-bump'
|
|
||||||
run: |
|
# Strip "v" prefix from tag name
|
||||||
sed -i "s%FROM b4tman/squid%FROM $TEST_TAG%" ssl-bump/Dockerfile
|
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||||
|
|
||||||
- name: Build 'ssl-bump' image
|
# Use Docker `latest` tag convention
|
||||||
uses: docker/build-push-action@v5
|
[ "$VERSION" == "master" ] && VERSION=latest
|
||||||
with:
|
|
||||||
context: .
|
echo IMAGE_ID=$IMAGE_ID
|
||||||
push: false
|
echo VERSION=$VERSION
|
||||||
load: true
|
|
||||||
tags: ${{ env.TEST_TAG }}-ssl-bump
|
docker tag b4tman/squid:ssl-bump $IMAGE_ID:$VERSION
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
docker push $IMAGE_ID:$VERSION
|
||||||
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:
|
|
||||||
needs: test
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
b4tman/squid
|
|
||||||
ghcr.io/b4tman/squid
|
|
||||||
flavor: |
|
|
||||||
latest=${{ github.ref == 'refs/heads/master' }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
|
|
||||||
- name: Docker meta (ssl-bump)
|
|
||||||
id: meta_ssl_bump
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
b4tman/squid
|
|
||||||
ghcr.io/b4tman/squid
|
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
suffix=-ssl-bump
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
|
|
||||||
- name: Docker meta (ssl-bump ghcr)
|
|
||||||
id: meta_ssl_bump_ghcr
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
ghcr.io/b4tman/squid-ssl-bump
|
|
||||||
flavor: |
|
|
||||||
latest=${{ github.ref == 'refs/heads/master' }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v4.0.0
|
|
||||||
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@v5
|
|
||||||
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@v5
|
|
||||||
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@v5
|
|
||||||
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
28
.github/workflows/stale.yml
vendored
@@ -1,28 +0,0 @@
|
|||||||
# 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.'
|
|
89
Dockerfile
89
Dockerfile
@@ -1,6 +1,9 @@
|
|||||||
FROM alpine:3.19.1 as build
|
FROM b4tman/armhf-alpine-qemu:latest as build
|
||||||
|
|
||||||
ARG SQUID_VER=6.7
|
ENV SQUID_VER 4.12
|
||||||
|
ENV SQUID_SIG_KEY B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E
|
||||||
|
|
||||||
|
RUN [ "cross-build-start" ]
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
@@ -9,8 +12,7 @@ RUN set -x && \
|
|||||||
libc-dev \
|
libc-dev \
|
||||||
curl \
|
curl \
|
||||||
gnupg \
|
gnupg \
|
||||||
openssl-dev \
|
libressl-dev \
|
||||||
openssl-libs-static \
|
|
||||||
perl-dev \
|
perl-dev \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
@@ -21,33 +23,34 @@ RUN set -x && \
|
|||||||
libcap-dev \
|
libcap-dev \
|
||||||
linux-headers
|
linux-headers
|
||||||
|
|
||||||
WORKDIR /tmp/build
|
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
curl -SsL http://www.squid-cache.org/Versions/v${SQUID_VER%%.*}/squid-${SQUID_VER}.tar.gz -o squid-${SQUID_VER}.tar.gz && \
|
mkdir -p /tmp/build && \
|
||||||
|
cd /tmp/build && \
|
||||||
|
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
|
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 && \
|
||||||
GNUPGHOME="$(mktemp -d)" && \
|
cd /tmp/build && \
|
||||||
export GNUPGHOME && \
|
export GNUPGHOME="$(mktemp -d)" && \
|
||||||
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="$MACHINE" \
|
--build="$(uname -m)" \
|
||||||
--host="$MACHINE" \
|
--host="$(uname -m)" \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--datadir=/usr/share/squid \
|
--datadir=/usr/share/squid \
|
||||||
--sysconfdir=/etc/squid \
|
--sysconfdir=/etc/squid \
|
||||||
@@ -58,12 +61,11 @@ 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,DB,RADIUS" \
|
--enable-auth-basic="getpwnam,NCSA" \
|
||||||
--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" \
|
||||||
--enable-auth-negotiate="kerberos,wrapper" \
|
--enable-auth-negotiate="wrapper" \
|
||||||
--enable-silent-rules \
|
--enable-silent-rules \
|
||||||
--disable-mit \
|
--disable-mit \
|
||||||
--enable-heimdal \
|
--enable-heimdal \
|
||||||
@@ -86,7 +88,7 @@ RUN set -x && \
|
|||||||
--enable-storeio="diskd rock" \
|
--enable-storeio="diskd rock" \
|
||||||
--enable-ipv6 \
|
--enable-ipv6 \
|
||||||
--enable-translation \
|
--enable-translation \
|
||||||
--enable-snmp \
|
--disable-snmp \
|
||||||
--disable-dependency-tracking \
|
--disable-dependency-tracking \
|
||||||
--with-large-files \
|
--with-large-files \
|
||||||
--with-default-user=squid \
|
--with-default-user=squid \
|
||||||
@@ -94,23 +96,22 @@ RUN set -x && \
|
|||||||
--with-pidfile=/var/run/squid/squid.pid
|
--with-pidfile=/var/run/squid/squid.pid
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
nproc=$(n=$(nproc) ; max_n=6 ; echo $(( n <= max_n ? n : max_n )) ) && \
|
cd /tmp/build && \
|
||||||
make -j $nproc && \
|
make -j $(grep -cs ^processor /proc/cpuinfo) && \
|
||||||
make install
|
make install
|
||||||
|
|
||||||
WORKDIR /tmp/build/tools/squidclient
|
RUN sed -i '1s;^;include /etc/squid/conf.d/*.conf\n;' /etc/squid/squid.conf
|
||||||
RUN make && make install-strip
|
RUN echo 'include /etc/squid/conf.d.tail/*.conf' >> /etc/squid/squid.conf
|
||||||
|
|
||||||
RUN sed -i '1s;^;include /etc/squid/conf.d/*.conf\n;' /etc/squid/squid.conf && \
|
RUN [ "cross-build-end" ]
|
||||||
echo 'include /etc/squid/conf.d.tail/*.conf' >> /etc/squid/squid.conf
|
|
||||||
|
|
||||||
# --- --- --- --- --- --- --- --- ---
|
FROM b4tman/armhf-alpine-qemu:latest
|
||||||
|
|
||||||
FROM alpine:3.19.1
|
|
||||||
|
|
||||||
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
|
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
|
||||||
ENV TZ Europe/Moscow
|
ENV TZ Europe/Moscow
|
||||||
|
|
||||||
|
RUN [ "cross-build-start" ]
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
deluser squid 2>/dev/null; delgroup squid 2>/dev/null; \
|
deluser squid 2>/dev/null; delgroup squid 2>/dev/null; \
|
||||||
addgroup -S squid -g 3128 && adduser -S -u 3128 -G squid -g squid -H -D -s /bin/false -h /var/cache/squid squid
|
addgroup -S squid -g 3128 && adduser -S -u 3128 -G squid -g squid -H -D -s /bin/false -h /var/cache/squid squid
|
||||||
@@ -119,33 +120,37 @@ RUN apk add --no-cache \
|
|||||||
libstdc++ \
|
libstdc++ \
|
||||||
heimdal-libs \
|
heimdal-libs \
|
||||||
libcap \
|
libcap \
|
||||||
libltdl
|
libressl3.1-libcrypto \
|
||||||
|
libressl3.1-libssl \
|
||||||
|
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
|
|
||||||
|
|
||||||
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
|
||||||
touch /etc/squid/conf.d/placeholder.conf
|
RUN 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 && \
|
RUN set -x && \
|
||||||
apk add --no-cache --virtual .tz alpine-conf tzdata && \
|
apk add --no-cache --virtual .tz alpine-conf tzdata && \
|
||||||
/sbin/setup-timezone -z $TZ && \
|
/sbin/setup-timezone -z $TZ && \
|
||||||
apk del .tz
|
apk del .tz
|
||||||
|
|
||||||
VOLUME ["/var/cache/squid"]
|
RUN [ "cross-build-end" ]
|
||||||
|
|
||||||
|
VOLUME ["/var/cache/squid"]
|
||||||
EXPOSE 3128/tcp
|
EXPOSE 3128/tcp
|
||||||
|
|
||||||
USER squid
|
USER squid
|
||||||
|
|
||||||
CMD ["sh", "-c", "rm -f /var/run/squid/squid.pid ; /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -YCd 1"]
|
CMD ["sh", "-c", "/usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -YCd 1"]
|
||||||
|
15
README.md
15
README.md
@@ -1,17 +1,13 @@
|
|||||||
|
[](https://microbadger.com/images/b4tman/squid:armhf "Get your own image badge on microbadger.com")
|
||||||
|
[](https://dependabot.com)
|
||||||
|

|
||||||

|

|
||||||
|
|
||||||
# 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:
|
Automated builds of the image are available on [Dockerhub](https://hub.docker.com/r/b4tman/squid).
|
||||||
|
|
||||||
- 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
|
||||||
|
|
||||||
@@ -34,6 +30,7 @@ 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
|
||||||
@@ -43,4 +40,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,20 +0,0 @@
|
|||||||
version: '2.3'
|
|
||||||
services:
|
|
||||||
proxy:
|
|
||||||
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:
|
|
||||||
image: "${TEST_TAG}"
|
|
||||||
links:
|
|
||||||
- proxy
|
|
||||||
depends_on:
|
|
||||||
- proxy
|
|
||||||
command: sh -exc "sleep 10 && squidclient -h proxy -T 3 'https://postman-echo.com/get?squidtest=ok' 2> /dev/null | grep -qF '200 OK'"
|
|
||||||
|
|
@@ -1,12 +1,12 @@
|
|||||||
version: '2'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
squid:
|
squid:
|
||||||
image: 'b4tman/squid'
|
image: 'b4tman/squid:armhf-cross'
|
||||||
container_name: 'my-squid'
|
container_name: 'my-squid'
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- '3128:3128'
|
- '3128:3128'
|
||||||
# environment:
|
# environment:
|
||||||
# SQUID_CONFIG_FILE: /etc/squid/my-squid.conf
|
# SQUID_CONFIG_FILE: /etc/squid/my-squid.conf
|
||||||
# volumes:
|
# volumes:
|
||||||
# - './my-squid.conf:/etc/squid/my-squid.conf:ro'
|
# - './my-squid.conf:/etc/squid/my-squid.conf:ro'
|
||||||
|
2067
squid-keys.asc
2067
squid-keys.asc
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
logfile_rotate 0
|
logfile_rotate 0
|
||||||
cache_store_log none
|
cache_store_log none
|
||||||
access_log stdio:/proc/self/fd/1
|
access_log stdio:/proc/self/fd/1
|
||||||
cache_log /dev/null
|
cache_log /dev/null
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
FROM b4tman/squid
|
FROM b4tman/squid:armhf-cross
|
||||||
|
|
||||||
COPY run.sh /
|
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"]
|
||||||
CMD ["/run.sh"]
|
|
@@ -1,14 +0,0 @@
|
|||||||
#!/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
|
|
@@ -1,11 +0,0 @@
|
|||||||
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