diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ccbf681..c3524fb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ on: env: DOCKER_REPO: shenxn/protonmail-bridge DOCKER_REPO_DEV: ghcr.io/shenxn/protonmail-bridge-dev - PLATFORMS: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/riscv64 + PLATFORMS: linux/amd64,linux/arm64/v8,linux/arm/v7 jobs: build: @@ -94,3 +94,5 @@ jobs: ${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}-build labels: ${{ steps.docker_meta.outputs.labels }} push: ${{ github.event_name != 'pull_request' }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/deb.yaml b/.github/workflows/deb.yaml index 2b2b4e0..e46f358 100644 --- a/.github/workflows/deb.yaml +++ b/.github/workflows/deb.yaml @@ -16,10 +16,16 @@ on: env: DOCKER_REPO: shenxn/protonmail-bridge DOCKER_REPO_DEV: ghcr.io/shenxn/protonmail-bridge-dev + PLATFORMS: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/riscv64 jobs: deb: runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5000:5000 steps: - name: Checkout uses: actions/checkout@v4 @@ -36,22 +42,25 @@ jobs: images: ${{ steps.repo.outputs.repo }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host - name: Build image without push uses: docker/build-push-action@v6 with: context: ./deb file: ./deb/Dockerfile - load: true - tags: protonmail-bridge:latest + push: true + tags: localhost:5000/protonmail-bridge:latest cache-from: type=gha cache-to: type=gha,mode=max + platforms: ${{ env.PLATFORMS }} - name: Scan image id: scan uses: anchore/scan-action@v4 with: - image: protonmail-bridge:latest + image: localhost:5000/protonmail-bridge:latest fail-build: false severity-cutoff: critical output-format: sarif @@ -80,5 +89,8 @@ jobs: tags: | ${{ steps.repo.outputs.repo }}:latest ${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }} + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.docker_meta.outputs.labels }} push: ${{ github.event_name != 'pull_request' }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/build/Dockerfile b/build/Dockerfile index 9af8ef8..e7151c1 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -16,7 +16,7 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ wget \ binutils \ xz-utils \ - libsecret-1-0 \ + libsecret-1-dev \ libgl1 # Build @@ -38,21 +38,21 @@ EXPOSE 143/tcp # && apt-get -y --no-install-recommends install \ # libc6 socat pass libsecret-1-0 ca-certificates -RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ - --mount=target=/var/cache/apt,type=cache,sharing=locked \ - rm -f /etc/apt/apt.conf.d/docker-clean \ - && apt-get update \ - && apt-get upgrade -y \ - && apt-get -y --no-install-recommends install \ - libc6 \ - socat \ - pass \ - ca-certificates \ - wget \ - binutils \ - xz-utils \ - libsecret-1-0 \ - libgl1 +# RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ +# --mount=target=/var/cache/apt,type=cache,sharing=locked \ +# rm -f /etc/apt/apt.conf.d/docker-clean \ +# && apt-get update \ +# && apt-get upgrade -y \ +# && apt-get -y --no-install-recommends install \ +# libc6 \ +# socat \ +# pass \ +# ca-certificates \ +# wget \ +# binutils \ +# xz-utils \ +# libsecret-1-dev \ +# libgl1 # Copy bash scripts COPY gpgparams entrypoint.sh /protonmail/