mirror of
https://github.com/b4tman/docker-squid.git
synced 2025-09-05 00:47:40 +00:00
Compare commits
18 Commits
armhf-new
...
armhf-cros
Author | SHA1 | Date | |
---|---|---|---|
9dab1b00cf
|
|||
9d46731628
|
|||
323e4533e7
|
|||
a83166d95e
|
|||
d040773634
|
|||
e3a188f419
|
|||
f37e4a4dfd
|
|||
158d177c51
|
|||
2bd558e146
|
|||
27509b05f6
|
|||
6f138189ff
|
|||
b5974723e8
|
|||
0ba2814cd6
|
|||
9315ec46b5
|
|||
8e5308aadf
|
|||
9d4c361f88 | |||
80bc95d75b | |||
cab0b65ef3 |
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
|
20
Dockerfile
20
Dockerfile
@@ -1,8 +1,10 @@
|
||||
FROM --platform=linux/armhf alpine:3.12.0 as build
|
||||
FROM b4tman/armhf-alpine-qemu:latest as build
|
||||
|
||||
ENV SQUID_VER 4.12
|
||||
ENV SQUID_SIG_KEY B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E
|
||||
|
||||
RUN [ "cross-build-start" ]
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache \
|
||||
gcc \
|
||||
@@ -97,15 +99,19 @@ 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 --platform=linux/armhf alpine:3.12.0
|
||||
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" ]
|
||||
|
||||
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
|
||||
@@ -139,7 +145,9 @@ 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
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[](https://microbadger.com/images/b4tman/squid:armhf "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)
|
||||

|
||||

|
||||
|
@@ -1,11 +0,0 @@
|
||||
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,7 +1,7 @@
|
||||
version: '2'
|
||||
services:
|
||||
squid:
|
||||
image: 'b4tman/squid:armhf'
|
||||
image: 'b4tman/squid:armhf-cross'
|
||||
container_name: 'my-squid'
|
||||
restart: always
|
||||
ports:
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FROM b4tman/squid:armhf
|
||||
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"]
|
Reference in New Issue
Block a user