mirror of
https://github.com/b4tman/docker-squid.git
synced 2024-11-22 19:26:54 +00:00
Merge branch 'armhf-new' into armhf-cross
# Conflicts: # Dockerfile
This commit is contained in:
commit
9dab1b00cf
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
|
84
.github/workflows/dockerimage.yml
vendored
Normal file
84
.github/workflows/dockerimage.yml
vendored
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
name: Docker Image CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
# Publish `master` as Docker `latest` image.
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- 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
|
31
Dockerfile
31
Dockerfile
@ -1,7 +1,7 @@
|
|||||||
FROM b4tman/armhf-alpine-qemu:3.8 as build
|
FROM b4tman/armhf-alpine-qemu:latest as build
|
||||||
|
|
||||||
ENV SQUID_VER 3.5.28
|
ENV SQUID_VER 4.12
|
||||||
ENV SQUID_SIG_KEY EA31CC5E9488E5168D2DCC5EB268E706FF5CF463
|
ENV SQUID_SIG_KEY B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E
|
||||||
|
|
||||||
RUN [ "cross-build-start" ]
|
RUN [ "cross-build-start" ]
|
||||||
|
|
||||||
@ -26,8 +26,8 @@ RUN set -x && \
|
|||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
mkdir -p /tmp/build && \
|
mkdir -p /tmp/build && \
|
||||||
cd /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-${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.asc -o squid-${SQUID_VER}.tar.gz.asc
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
cd /tmp/build && \
|
cd /tmp/build && \
|
||||||
@ -73,6 +73,7 @@ RUN set -x && \
|
|||||||
--enable-arp-acl \
|
--enable-arp-acl \
|
||||||
--enable-openssl \
|
--enable-openssl \
|
||||||
--enable-ssl-crtd \
|
--enable-ssl-crtd \
|
||||||
|
--enable-security-cert-generators="file" \
|
||||||
--enable-ident-lookups \
|
--enable-ident-lookups \
|
||||||
--enable-useragent-log \
|
--enable-useragent-log \
|
||||||
--enable-cache-digests \
|
--enable-cache-digests \
|
||||||
@ -99,9 +100,12 @@ RUN set -x && \
|
|||||||
make -j $(grep -cs ^processor /proc/cpuinfo) && \
|
make -j $(grep -cs ^processor /proc/cpuinfo) && \
|
||||||
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
|
||||||
|
|
||||||
RUN [ "cross-build-end" ]
|
RUN [ "cross-build-end" ]
|
||||||
|
|
||||||
FROM b4tman/armhf-alpine-qemu:3.8
|
FROM b4tman/armhf-alpine-qemu:latest
|
||||||
|
|
||||||
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
|
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
|
||||||
ENV TZ Europe/Moscow
|
ENV TZ Europe/Moscow
|
||||||
@ -116,8 +120,8 @@ RUN apk add --no-cache \
|
|||||||
libstdc++ \
|
libstdc++ \
|
||||||
heimdal-libs \
|
heimdal-libs \
|
||||||
libcap \
|
libcap \
|
||||||
libressl2.7-libcrypto \
|
libressl3.1-libcrypto \
|
||||||
libressl2.7-libssl \
|
libressl3.1-libssl \
|
||||||
libltdl
|
libltdl
|
||||||
|
|
||||||
COPY --from=build /etc/squid/ /etc/squid/
|
COPY --from=build /etc/squid/ /etc/squid/
|
||||||
@ -131,15 +135,16 @@ RUN install -d -o squid -g squid \
|
|||||||
/var/run/squid && \
|
/var/run/squid && \
|
||||||
chmod +x /usr/lib/squid/*
|
chmod +x /usr/lib/squid/*
|
||||||
|
|
||||||
RUN echo 'include /etc/squid/conf.d/*.conf' >> "$SQUID_CONFIG_FILE" && \
|
RUN install -d -m 755 -o squid -g squid \
|
||||||
install -d -m 755 -o squid -g squid /etc/squid/conf.d
|
/etc/squid/conf.d \
|
||||||
COPY squid-log.conf /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 && \
|
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
|
||||||
|
|
||||||
|
|
||||||
RUN [ "cross-build-end" ]
|
RUN [ "cross-build-end" ]
|
||||||
|
|
||||||
@ -148,4 +153,4 @@ EXPOSE 3128/tcp
|
|||||||
|
|
||||||
USER squid
|
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,7 @@
|
|||||||
[![](https://images.microbadger.com/badges/image/b4tman/squid:armhf.svg)](https://microbadger.com/images/b4tman/squid:armhf "Get your own image badge on microbadger.com")
|
[![](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
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
version: '2'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
squid:
|
squid:
|
||||||
image: 'b4tman/squid:armhf'
|
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'
|
||||||
|
@ -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 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:armhf-cross
|
||||||
|
|
||||||
|
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"]
|
Loading…
Reference in New Issue
Block a user