mirror of
https://github.com/b4tman/docker-squid.git
synced 2025-12-08 10:43:04 +00:00
Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
bb5513fac9
|
|||
|
20ef8cf8be
|
|||
|
|
a6b68820a9 | ||
| d1e2082f73 | |||
| 70ac196b86 | |||
|
|
15cf0f1674 | ||
|
|
72ef256dfe | ||
|
|
74a4ac3993 | ||
|
aabc247a2b
|
|||
|
9f6c88ad96
|
|||
|
b5e86101ef
|
|||
|
63c7ba99e9
|
|||
|
7ac8996e39
|
|||
|
d92da9a79d
|
|||
|
11434c9296
|
|||
|
9e51552e39
|
|||
|
2c911aad44
|
|||
|
2c8641472e
|
|||
|
be6513f835
|
|||
|
f2f586f586
|
|||
|
382a181d1a
|
|||
|
a68a4dc255
|
|||
|
6f612170e6
|
|||
| 876c6f0678 | |||
| f384c90781 | |||
| 266a711b36 | |||
| 7f55a91c1d | |||
| 247d11d625 |
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: docker
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: monthly
|
||||
time: '02:00'
|
||||
open-pull-requests-limit: 10
|
||||
97
.github/workflows/dockerimage.yml
vendored
97
.github/workflows/dockerimage.yml
vendored
@@ -1,97 +0,0 @@
|
||||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
# Publish `master` as Docker `latest` image.
|
||||
branches:
|
||||
- master
|
||||
|
||||
# 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: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
||||
|
||||
- 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: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
||||
|
||||
- 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
|
||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -1,4 +0,0 @@
|
||||
[submodule "squid"]
|
||||
path = squid
|
||||
url = https://github.com/squid-cache/squid
|
||||
branch = v5
|
||||
42
Dockerfile
42
Dockerfile
@@ -1,4 +1,7 @@
|
||||
FROM alpine:3.11.3 as build
|
||||
FROM --platform=linux/armhf alpine:3.12.0 as build
|
||||
|
||||
ENV SQUID_VER 4.12
|
||||
ENV SQUID_SIG_KEY B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache \
|
||||
@@ -18,15 +21,27 @@ RUN set -x && \
|
||||
libcap-dev \
|
||||
linux-headers
|
||||
|
||||
COPY squid /tmp/build
|
||||
WORKDIR /tmp/build/
|
||||
|
||||
RUN sed -i 's/ed -s/ed/g' bootstrap.sh
|
||||
RUN ln -s /usr/bin/aclocal-1.16 /usr/bin/aclocal-1.15
|
||||
RUN ln -s /usr/bin/automake-1.16 /usr/bin/automake-1.15
|
||||
RUN sh bootstrap.sh
|
||||
|
||||
RUN \
|
||||
RUN set -x && \
|
||||
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 && \
|
||||
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 && \
|
||||
\
|
||||
CFLAGS="-g0 -O2" \
|
||||
CXXFLAGS="-g0 -O2" \
|
||||
LDFLAGS="-s" \
|
||||
@@ -79,13 +94,14 @@ RUN \
|
||||
--with-pidfile=/var/run/squid/squid.pid
|
||||
|
||||
RUN set -x && \
|
||||
cd /tmp/build && \
|
||||
make -j $(grep -cs ^processor /proc/cpuinfo) && \
|
||||
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.11.3
|
||||
FROM --platform=linux/armhf alpine:3.12.0
|
||||
|
||||
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
|
||||
ENV TZ Europe/Moscow
|
||||
@@ -98,8 +114,8 @@ RUN apk add --no-cache \
|
||||
libstdc++ \
|
||||
heimdal-libs \
|
||||
libcap \
|
||||
libressl3.0-libcrypto \
|
||||
libressl3.0-libssl \
|
||||
libressl3.1-libcrypto \
|
||||
libressl3.1-libssl \
|
||||
libltdl
|
||||
|
||||
COPY --from=build /etc/squid/ /etc/squid/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[](https://microbadger.com/images/b4tman/squid "Get your own image badge on microbadger.com")
|
||||
[](https://microbadger.com/images/b4tman/squid:armhf "Get your own image badge on microbadger.com")
|
||||
[](https://dependabot.com)
|
||||

|
||||

|
||||

|
||||
|
||||
# docker-squid
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
version: '2'
|
||||
services:
|
||||
proxy:
|
||||
build: .
|
||||
sut:
|
||||
image: alpine:3.10.1
|
||||
links:
|
||||
- proxy
|
||||
depends_on:
|
||||
- proxy
|
||||
command: sh -exc "apk add --update curl && sleep 5 && exec curl --proxy http://proxy:3128 -I http://google.com/"
|
||||
version: '2'
|
||||
services:
|
||||
proxy:
|
||||
build: .
|
||||
sut:
|
||||
image: alpine:3.10.1
|
||||
links:
|
||||
- proxy
|
||||
depends_on:
|
||||
- proxy
|
||||
command: sh -exc "apk add --update curl && sleep 5 && exec curl --proxy http://proxy:3128 -I http://google.com/"
|
||||
|
||||
@@ -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'
|
||||
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'
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
git submodule update --init
|
||||
|
||||
1
squid
1
squid
Submodule squid deleted from f4ade365f8
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM b4tman/squid
|
||||
|
||||
USER root
|
||||
FROM b4tman/squid:armhf
|
||||
|
||||
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"]
|
||||
Reference in New Issue
Block a user