mirror of
https://github.com/b4tman/docker-squid.git
synced 2024-11-22 11:16:55 +00:00
Update ci (#44)
* + ghcr.io links * update ci * more cache moves * fix cache move after compose test * output image * update description and don't login on PR's * dependabot: actions
This commit is contained in:
parent
ba0d25813e
commit
0dcc835803
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@ -1,8 +1,14 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: docker
|
- package-ecosystem: docker
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: monthly
|
||||||
time: '02:00'
|
time: "02:00"
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
time: "03:00"
|
||||||
|
229
.github/workflows/dockerimage.yml
vendored
229
.github/workflows/dockerimage.yml
vendored
@ -10,74 +10,215 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
|
||||||
# Run tests for any PRs.
|
# Run tests for PRs to `master` branch.
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Build squid image
|
- name: Set up QEMU
|
||||||
run: docker build . --file Dockerfile --tag b4tman/squid
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Test image
|
- name: Set up Docker Buildx
|
||||||
run: docker-compose -f docker-compose.test.yml up sut
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Build 'ssl-bump' image
|
- name: Login to DockerHub
|
||||||
run: docker build ssl-bump --tag b4tman/squid:ssl-bump
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: b4tman
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
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@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: false
|
||||||
|
tags: b4tman/squid
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||||
|
outputs: type=image,name=b4tman/squid,push=false
|
||||||
|
|
||||||
|
# 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: docker-compose -f docker-compose.test.yml up sut
|
||||||
|
|
||||||
|
- name: Build 'ssl-bump' image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: ssl-bump
|
||||||
|
push: false
|
||||||
|
file: ssl-bump/Dockerfile
|
||||||
|
tags: b4tman/squid:ssl-bump
|
||||||
|
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
|
||||||
|
|
||||||
push:
|
push:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-20.04
|
||||||
if: github.event_name == 'push'
|
if: github.event_name != 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Build squid image
|
- name: Docker meta
|
||||||
run: docker build . --file Dockerfile --tag b4tman/squid
|
id: meta
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
b4tman/squid
|
||||||
|
ghcr.io/b4tman/squid
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
|
||||||
- name: Build 'ssl-bump' image
|
- name: Docker meta (ssl-bump)
|
||||||
run: docker build ssl-bump --tag b4tman/squid:ssl-bump
|
id: meta_ssl_bump
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
b4tman/squid
|
||||||
|
ghcr.io/b4tman/squid
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
suffix=ssl-bump
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
|
||||||
- name: Log into registry
|
- name: Docker meta (ssl-bump ghcr)
|
||||||
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
id: meta_ssl_bump_ghcr
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/b4tman/squid-ssl-bump
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
|
||||||
- name: Push squid image
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v1
|
||||||
IMAGE_ID=ghcr.io/${{ github.actor }}/squid
|
|
||||||
|
|
||||||
# Strip git ref prefix from version
|
- name: Set up Docker Buildx
|
||||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
# Strip "v" prefix from tag name
|
- name: Cache Docker layers
|
||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
# Use Docker `latest` tag convention
|
- name: Login to DockerHub
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: b4tman
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
- name: Login to GHCR
|
||||||
echo VERSION=$VERSION
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.CR_PAT }}
|
||||||
|
|
||||||
docker tag b4tman/squid $IMAGE_ID:$VERSION
|
- name: Build squid image
|
||||||
docker push $IMAGE_ID:$VERSION
|
uses: docker/build-push-action@v2
|
||||||
|
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
|
||||||
|
|
||||||
- name: Push 'ssl-bump' image
|
# Temp fix
|
||||||
run: |
|
# https://github.com/docker/build-push-action/issues/252
|
||||||
IMAGE_ID=ghcr.io/${{ github.actor }}/squid-ssl-bump
|
# https://github.com/moby/buildkit/issues/1896
|
||||||
|
- name: Move cache
|
||||||
|
run: |
|
||||||
|
rm -rf /tmp/.buildx-cache
|
||||||
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||||
|
|
||||||
# Strip git ref prefix from version
|
- name: Build 'ssl-bump' image
|
||||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
uses: docker/build-push-action@v2
|
||||||
|
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
|
||||||
|
|
||||||
# Strip "v" prefix from tag name
|
# Temp fix
|
||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
# 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
|
||||||
|
|
||||||
# Use Docker `latest` tag convention
|
- name: Build 'ssl-bump' image for ghcr
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest
|
uses: docker/build-push-action@v2
|
||||||
|
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
|
||||||
|
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
# Temp fix
|
||||||
echo VERSION=$VERSION
|
# 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
|
||||||
|
|
||||||
docker tag b4tman/squid:ssl-bump $IMAGE_ID:$VERSION
|
- name: Update repo description
|
||||||
docker push $IMAGE_ID:$VERSION
|
uses: peter-evans/dockerhub-description@v2
|
||||||
|
with:
|
||||||
|
username: b4tman
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
repository: b4tman/app
|
||||||
|
10
README.md
10
README.md
@ -6,7 +6,14 @@
|
|||||||
|
|
||||||
Docker Squid container based on Alpine Linux.
|
Docker Squid container based on Alpine Linux.
|
||||||
|
|
||||||
Automated builds of the image are available on [Dockerhub](https://hub.docker.com/r/b4tman/squid).
|
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)
|
||||||
|
|
||||||
# Quick Start
|
# Quick Start
|
||||||
|
|
||||||
@ -29,7 +36,6 @@ docker-compose up
|
|||||||
|
|
||||||
- **SQUID_CONFIG_FILE**: Specify the configuration file for squid. Defaults to `/etc/squid/squid.conf`.
|
- **SQUID_CONFIG_FILE**: Specify the configuration file for squid. Defaults to `/etc/squid/squid.conf`.
|
||||||
|
|
||||||
|
|
||||||
## Example:
|
## Example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
Loading…
Reference in New Issue
Block a user