1
0
mirror of https://github.com/b4tman/docker-squid.git synced 2025-09-01 15:07:30 +00:00

39 Commits

Author SHA1 Message Date
9dab1b00cf Merge branch 'armhf-new' into armhf-cross
# Conflicts:
#	Dockerfile
2020-08-11 13:00:34 +03:00
20ef8cf8be Merge branch 'master' into armhf
# Conflicts:
#	Dockerfile
#	README.md
2020-08-11 11:22:35 +03:00
9d46731628 bump alpine to 3.8
(cherry picked from commit d5cbd68b4d)
2018-07-19 13:57:34 +03:00
323e4533e7 bump to 3.5.28
(cherry picked from commit 9e6ed88e57)
2018-07-19 13:56:26 +03:00
aabc247a2b bump alpine to 3.8
(cherry picked from commit d5cbd68b4d)
2018-07-19 13:56:03 +03:00
9f6c88ad96 bump to 3.5.28
(cherry picked from commit 9e6ed88e57)
2018-07-19 13:53:01 +03:00
a83166d95e fix second FROM 2018-02-28 21:52:54 +03:00
d040773634 fix build error "Address not available"
(cherry picked from commit a3b384fd87)
2018-02-28 13:18:03 +03:00
b5e86101ef fix build error "Address not available"
(cherry picked from commit a3b384fd87)
2018-02-28 13:17:32 +03:00
e3a188f419 MAINTAINER removed 2018-02-28 13:10:33 +03:00
f37e4a4dfd bump alpine to 3.7
(cherry picked from commit 6996f4b15d)
2018-02-28 13:09:53 +03:00
158d177c51 MAINTAINER removed
(cherry picked from commit 6f69039cbb)
2018-02-28 13:04:12 +03:00
2bd558e146 multi-stage build
(cherry picked from commit dcb8862e75)
2018-02-28 13:03:14 +03:00
63c7ba99e9 MAINTAINER removed
(cherry picked from commit 6f69039cbb)
2018-02-28 12:47:57 +03:00
7ac8996e39 bump alpine to 3.7
(cherry picked from commit 6996f4b15d)
2018-02-28 12:46:23 +03:00
d92da9a79d multi-stage build
(cherry picked from commit dcb8862e75)
2018-02-28 12:43:05 +03:00
11434c9296 parallel compile jobs
(cherry picked from commit 27509b05f6)
2018-02-28 12:39:35 +03:00
9e51552e39 MAINTAINER removed 2018-02-28 11:32:26 +03:00
2c911aad44 FROM arm32v6/alpine 2018-02-28 11:31:21 +03:00
27509b05f6 parallel compile jobs 2017-09-21 10:50:41 +03:00
6f138189ff update README
(cherry picked from commit 2c8641472e)
2017-09-20 13:54:17 +03:00
2c8641472e update README 2017-09-20 13:52:46 +03:00
be6513f835 FROM container4armhf/armhf-alpine 2017-09-20 13:49:43 +03:00
b5974723e8 bump squid to 3.5.27
(cherry picked from commit cbce834670)
2017-09-20 13:31:16 +03:00
f2f586f586 bump squid to 3.5.27
(cherry picked from commit cbce834670)
2017-09-20 13:30:24 +03:00
0ba2814cd6 Merge branch 'master' into armhf-cross 2017-07-04 09:59:24 +03:00
382a181d1a Merge branch 'master' into armhf 2017-07-04 09:57:04 +03:00
9315ec46b5 bump b4tman/armhf-alpine-qemu to 3.6 2017-07-03 14:07:35 +03:00
a68a4dc255 bump armhf/alpine to 3.6 2017-07-03 13:54:41 +03:00
8e5308aadf update to 3.5.26
Merge branch 'master' into armhf-cross
2017-06-06 19:40:43 +03:00
6f612170e6 update to 3.5.26
Merge branch 'master' into armhf
2017-06-06 19:38:29 +03:00
9d4c361f88 ignore apk errors (from post-install triggers) 2017-05-12 15:13:40 +03:00
80bc95d75b Merge branch 'armhf' into armhf-cross
# Conflicts:
#	Dockerfile
2017-05-12 11:23:07 +03:00
876c6f0678 Merge branch 'master' into armhf
# Conflicts:
#	Dockerfile
2017-05-12 10:58:37 +03:00
cab0b65ef3 cross build using qemu 2017-03-07 21:03:51 +03:00
f384c90781 Merge branch 'master' into armhf
# Conflicts:
#	docker-compose.yml
2017-02-13 14:28:26 +03:00
266a711b36 docker-entrypoint permissions fix [armhf] 2017-02-08 10:55:02 +03:00
7f55a91c1d docker-compose armhf build tag 2017-02-08 10:19:48 +03:00
247d11d625 armhf version 2017-02-08 10:16:23 +03:00
15 changed files with 165 additions and 2513 deletions

View File

@@ -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

1
.github/FUNDING.yml vendored
View File

@@ -1 +0,0 @@
custom: ['https://boosty.to/0xffff', 'https://www.donationalerts.com/r/b4tman1']

View File

@@ -1,14 +1,8 @@
version: 2
updates:
- package-ecosystem: docker
directory: "/"
schedule:
interval: monthly
time: "02:00"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
time: "03:00"
- package-ecosystem: docker
directory: "/"
schedule:
interval: monthly
time: '02:00'
open-pull-requests-limit: 10

View File

@@ -1,233 +1,84 @@
name: Docker Image CI
on:
push:
# Publish `master` as Docker `latest` image.
branches:
name: Docker Image CI
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
- v5
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for PRs to `master` branch.
pull_request:
branches:
- "master"
env:
TEST_TAG: b4tman/squid:test
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
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.0
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:
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.2.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@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
- armhf-cross
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
jobs:
test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build squid image
run: docker build . --file Dockerfile --tag b4tman/squid
- name: Test image
run: docker-compose -f docker-compose.test.yml up sut
- name: Build 'ssl-bump' image
run: docker build ssl-bump --tag b4tman/squid:ssl-bump
push:
needs: test
runs-on: ubuntu-18.04
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build squid image
run: docker build . --file Dockerfile --tag b4tman/squid
- name: Build 'ssl-bump' image
run: docker build ssl-bump --tag b4tman/squid:ssl-bump
- name: Log into registry
run: echo "${{ secrets.GITHUB_PKGS_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push squid image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/squid
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag b4tman/squid $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push 'ssl-bump' image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/ssl-bump
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag b4tman/squid:ssl-bump $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION

View File

@@ -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.'

View File

@@ -1,6 +1,9 @@
FROM alpine:3.21.2 as build
FROM b4tman/armhf-alpine-qemu:latest as build
ARG SQUID_VER=6.13
ENV SQUID_VER 4.12
ENV SQUID_SIG_KEY B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E
RUN [ "cross-build-start" ]
RUN set -x && \
apk add --no-cache \
@@ -9,8 +12,7 @@ RUN set -x && \
libc-dev \
curl \
gnupg \
openssl-dev \
openssl-libs-static \
libressl-dev \
perl-dev \
autoconf \
automake \
@@ -21,33 +23,34 @@ RUN set -x && \
libcap-dev \
linux-headers
WORKDIR /tmp/build
RUN set -x && \
curl -fSsL "https://github.com/squid-cache/squid/releases/download/SQUID_${SQUID_VER//./_}/squid-${SQUID_VER}.tar.gz" -o squid-${SQUID_VER}.tar.gz && \
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
COPY squid-keys.asc /tmp/build
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
RUN set -x && \
GNUPGHOME="$(mktemp -d)" && \
export GNUPGHOME && \
gpg --import squid-keys.asc && \
cd /tmp/build && \
export GNUPGHOME="$(mktemp -d)" && \
( \
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 && \
rm -rf "$GNUPGHOME"
RUN set -x && \
cd /tmp/build && \
tar --strip 1 -xzf squid-${SQUID_VER}.tar.gz && \
\
MACHINE=$(uname -m) && \
\
CFLAGS="-g0 -O2" \
CXXFLAGS="-g0 -O2" \
LDFLAGS="-s" \
\
./configure \
--build="$MACHINE" \
--host="$MACHINE" \
--build="$(uname -m)" \
--host="$(uname -m)" \
--prefix=/usr \
--datadir=/usr/share/squid \
--sysconfdir=/etc/squid \
@@ -58,12 +61,11 @@ RUN set -x && \
--disable-arch-native \
--enable-removal-policies="lru,heap" \
--enable-auth-digest \
--enable-auth-basic="getpwnam,NCSA,DB,RADIUS" \
--enable-basic-auth-helpers="DB" \
--enable-auth-basic="getpwnam,NCSA" \
--enable-epoll \
--enable-external-acl-helpers="file_userip,unix_group,wbinfo_group" \
--enable-auth-ntlm="fake" \
--enable-auth-negotiate="kerberos,wrapper" \
--enable-auth-negotiate="wrapper" \
--enable-silent-rules \
--disable-mit \
--enable-heimdal \
@@ -86,7 +88,7 @@ RUN set -x && \
--enable-storeio="diskd rock" \
--enable-ipv6 \
--enable-translation \
--enable-snmp \
--disable-snmp \
--disable-dependency-tracking \
--with-large-files \
--with-default-user=squid \
@@ -94,23 +96,22 @@ RUN set -x && \
--with-pidfile=/var/run/squid/squid.pid
RUN set -x && \
nproc=$(n=$(nproc) ; max_n=6 ; echo $(( n <= max_n ? n : max_n )) ) && \
make -j $nproc && \
cd /tmp/build && \
make -j $(grep -cs ^processor /proc/cpuinfo) && \
make install
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
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 && \
echo 'include /etc/squid/conf.d.tail/*.conf' >> /etc/squid/squid.conf
RUN [ "cross-build-end" ]
# --- --- --- --- --- --- --- --- ---
FROM alpine:3.21.2
FROM b4tman/armhf-alpine-qemu:latest
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
ENV TZ Europe/Moscow
RUN [ "cross-build-start" ]
RUN set -x && \
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
@@ -119,31 +120,37 @@ RUN apk add --no-cache \
libstdc++ \
heimdal-libs \
libcap \
libltdl \
tzdata
libressl3.1-libcrypto \
libressl3.1-libssl \
libltdl
COPY --from=build /etc/squid/ /etc/squid/
COPY --from=build /usr/lib/squid/ /usr/lib/squid/
COPY --from=build /usr/share/squid/ /usr/share/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 \
/var/cache/squid \
/var/log/squid \
/var/run/squid && \
chmod +x /usr/lib/squid/* && \
install -d -m 755 -o squid -g squid \
chmod +x /usr/lib/squid/*
RUN install -d -m 755 -o squid -g squid \
/etc/squid/conf.d \
/etc/squid/conf.d.tail && \
touch /etc/squid/conf.d/placeholder.conf
/etc/squid/conf.d.tail
RUN touch /etc/squid/conf.d/placeholder.conf
COPY squid-log.conf /etc/squid/conf.d.tail/
VOLUME ["/var/cache/squid"]
RUN set -x && \
apk add --no-cache --virtual .tz alpine-conf tzdata && \
/sbin/setup-timezone -z $TZ && \
apk del .tz
RUN [ "cross-build-end" ]
VOLUME ["/var/cache/squid"]
EXPOSE 3128/tcp
USER squid
CMD ["/run.sh"]
CMD ["sh", "-c", "/usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -YCd 1"]

View File

@@ -1,17 +1,13 @@
[![](https://images.microbadger.com/badges/image/b4tman/squid:armhf-cross.svg)](https://microbadger.com/images/b4tman/squid:armhf "Get your own image badge on microbadger.com")
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=b4tman/docker-squid)](https://dependabot.com)
![Docker Build Status](https://img.shields.io/docker/build/b4tman/squid)
![Docker Image CI Status](https://github.com/b4tman/docker-squid/workflows/Docker%20Image%20CI/badge.svg)
# docker-squid
Docker Squid container based on Alpine Linux.
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)
Automated builds of the image are available on [Dockerhub](https://hub.docker.com/r/b4tman/squid).
# Quick Start
@@ -34,6 +30,7 @@ docker-compose up
- **SQUID_CONFIG_FILE**: Specify the configuration file for squid. Defaults to `/etc/squid/squid.conf`.
## Example:
```bash
@@ -43,4 +40,4 @@ docker run -p 3128:3128 \
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`.

View File

@@ -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'"

View File

@@ -1,12 +1,12 @@
version: '2'
services:
squid:
image: 'b4tman/squid'
container_name: 'my-squid'
restart: always
ports:
- '3128:3128'
# environment:
# SQUID_CONFIG_FILE: /etc/squid/my-squid.conf
# volumes:
# - './my-squid.conf:/etc/squid/my-squid.conf:ro'
version: '2'
services:
squid:
image: 'b4tman/squid:armhf-cross'
container_name: 'my-squid'
restart: always
ports:
- '3128:3128'
# environment:
# SQUID_CONFIG_FILE: /etc/squid/my-squid.conf
# volumes:
# - './my-squid.conf:/etc/squid/my-squid.conf:ro'

14
run.sh
View File

@@ -1,14 +0,0 @@
#!/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

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
logfile_rotate 0
cache_store_log none
access_log stdio:/proc/self/fd/1
cache_log /dev/null
logfile_rotate 0
cache_store_log none
access_log stdio:/proc/self/fd/1
cache_log /dev/null

View File

@@ -1,9 +1,4 @@
FROM b4tman/squid
COPY run.sh /
USER root
RUN chmod 755 /run.sh
FROM b4tman/squid:armhf-cross
USER squid
CMD ["/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"]

View File

@@ -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

View File

@@ -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