mirror of
https://github.com/b4tman/docker-squid.git
synced 2025-09-26 10:09:10 +00:00
Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
bee8e01cb0 | |||
e36539188f
|
|||
ebe487186b
|
|||
6e0968cb97
|
|||
9aa1dbd893
|
|||
1a682a86c9
|
|||
cb78e8c285
|
|||
4251447c9d | |||
e4ce0fe599 | |||
|
a6b68820a9 | ||
d1e2082f73 | |||
70ac196b86 | |||
|
15cf0f1674 | ||
|
72ef256dfe | ||
|
74a4ac3993 | ||
f709ee39b4
|
|||
a3b428e958
|
|||
0ca618e4a0
|
|||
|
cf301af570 | ||
483a6c83de | |||
4e7b30df68 | |||
|
6b9adeb25a | ||
|
63fcfbd66f | ||
a9785a47bc
|
|||
8394735252 | |||
5092f79c09
|
|||
f49f923a2b | |||
bbf973390f
|
|||
|
9e3ce9a7e4 | ||
b15fe81ac6
|
|||
e2bc962b39 | |||
e513e356c7
|
|||
af1abd0039 | |||
|
b462213727 | ||
|
d1a9592a3f | ||
127d9c258c
|
|||
88f5272b9e
|
|||
c057771360
|
|||
|
56930ae938 | ||
34910856c7
|
|||
82982b2ac5
|
|||
88a2d623e4
|
|||
7388c631e8
|
|||
06757f1033
|
|||
2398325ccb
|
|||
7ae134af14
|
|||
d26782c0b3
|
|||
e4d312e05e
|
|||
2a8b885fad
|
|||
9b081c8cec
|
|||
6c614c0f90
|
|||
a3b384fd87
|
|||
6f69039cbb
|
|||
393e77b80d
|
|||
fe0e5831e1
|
|||
bd235e7e19
|
|||
b42486dc88
|
|||
8a016f4d1e
|
|||
25d8d427fe
|
|||
7393b0da87
|
|||
5ea9da0782
|
|||
d059b7d2cd |
33
.drone.yml
Normal file
33
.drone.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
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
|
||||
- name: squid-armhf image for github packages
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: docker.pkg.github.com/b4tman/docker-squid/squid-armhf
|
||||
auto_tag: true
|
||||
pull_image: true
|
||||
registry: docker.pkg.github.com
|
||||
username: b4tman
|
||||
password:
|
||||
from_secret: github_password
|
||||
trigger:
|
||||
ref:
|
||||
- refs/tags/**
|
||||
- refs/heads/master
|
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
|
83
.github/workflows/dockerimage.yml
vendored
Normal file
83
.github/workflows/dockerimage.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
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: 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
|
35
Dockerfile
35
Dockerfile
@@ -1,7 +1,7 @@
|
||||
FROM alpine:3.8 as build
|
||||
FROM alpine:3.12.0 as build
|
||||
|
||||
ENV SQUID_VER 3.5.28
|
||||
ENV SQUID_SIG_KEY EA31CC5E9488E5168D2DCC5EB268E706FF5CF463
|
||||
ENV SQUID_VER 4.13
|
||||
ENV SQUID_SIG_KEY B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache \
|
||||
@@ -24,8 +24,8 @@ RUN set -x && \
|
||||
RUN set -x && \
|
||||
mkdir -p /tmp/build && \
|
||||
cd /tmp/build && \
|
||||
curl -SsL http://www.squid-cache.org/Versions/v${SQUID_VER%.*.*}/${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_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
|
||||
|
||||
RUN set -x && \
|
||||
cd /tmp/build && \
|
||||
@@ -63,7 +63,7 @@ RUN set -x && \
|
||||
--enable-epoll \
|
||||
--enable-external-acl-helpers="file_userip,unix_group,wbinfo_group" \
|
||||
--enable-auth-ntlm="fake" \
|
||||
--enable-auth-negotiate="wrapper" \
|
||||
--enable-auth-negotiate="kerberos,wrapper" \
|
||||
--enable-silent-rules \
|
||||
--disable-mit \
|
||||
--enable-heimdal \
|
||||
@@ -71,6 +71,7 @@ RUN set -x && \
|
||||
--enable-arp-acl \
|
||||
--enable-openssl \
|
||||
--enable-ssl-crtd \
|
||||
--enable-security-cert-generators="file" \
|
||||
--enable-ident-lookups \
|
||||
--enable-useragent-log \
|
||||
--enable-cache-digests \
|
||||
@@ -94,10 +95,14 @@ RUN set -x && \
|
||||
|
||||
RUN set -x && \
|
||||
cd /tmp/build && \
|
||||
make -j $(grep -cs ^processor /proc/cpuinfo) && \
|
||||
nproc=$(n=$(nproc) ; max_n=6 ; [ $n -le $max_n ] && echo $n || echo $max_n) && \
|
||||
make -j $nproc && \
|
||||
make install
|
||||
|
||||
FROM alpine:3.8
|
||||
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
|
||||
|
||||
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
|
||||
ENV TZ Europe/Moscow
|
||||
@@ -110,8 +115,8 @@ RUN apk add --no-cache \
|
||||
libstdc++ \
|
||||
heimdal-libs \
|
||||
libcap \
|
||||
libressl2.7-libcrypto \
|
||||
libressl2.7-libssl \
|
||||
libressl3.1-libcrypto \
|
||||
libressl3.1-libssl \
|
||||
libltdl
|
||||
|
||||
COPY --from=build /etc/squid/ /etc/squid/
|
||||
@@ -125,9 +130,11 @@ RUN install -d -o squid -g squid \
|
||||
/var/run/squid && \
|
||||
chmod +x /usr/lib/squid/*
|
||||
|
||||
RUN echo 'include /etc/squid/conf.d/*.conf' >> "$SQUID_CONFIG_FILE" && \
|
||||
install -d -m 755 -o squid -g squid /etc/squid/conf.d
|
||||
COPY squid-log.conf /etc/squid/conf.d/
|
||||
RUN install -d -m 755 -o squid -g squid \
|
||||
/etc/squid/conf.d \
|
||||
/etc/squid/conf.d.tail
|
||||
RUN touch /etc/squid/conf.d/placeholder.conf
|
||||
COPY squid-log.conf /etc/squid/conf.d.tail/
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache --virtual .tz alpine-conf tzdata && \
|
||||
@@ -139,4 +146,4 @@ EXPOSE 3128/tcp
|
||||
|
||||
USER squid
|
||||
|
||||
CMD ["sh", "-c", "/usr/sbin/squid -f ${SQUID_CONFIG_FILE} -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} -NYCd 1"]
|
||||
CMD ["sh", "-c", "/usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -YCd 1"]
|
||||
|
@@ -1,4 +1,6 @@
|
||||
[](https://microbadger.com/images/b4tman/squid "Get your own image badge on microbadger.com")
|
||||
[](https://cloud.drone.io/b4tman/docker-squid)
|
||||

|
||||

|
||||
|
||||
# docker-squid
|
||||
|
||||
|
11
docker-compose.test.yml
Normal file
11
docker-compose.test.yml
Normal file
@@ -0,0 +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/"
|
@@ -1,4 +1,4 @@
|
||||
logfile_rotate 0
|
||||
cache_store_log none
|
||||
access_log stdio:/proc/self/fd/1
|
||||
cache_log stdio:/proc/self/fd/2
|
||||
cache_log /dev/null
|
||||
|
4
ssl-bump/Dockerfile
Normal file
4
ssl-bump/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM b4tman/squid
|
||||
|
||||
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