Skip to content

Commit ca1fa38

Browse files
authored
Migrate docker builds to AWS (#210)
* attempt to run docker build on AWS * add missing parameter * remove buildspec override * try adjusting token permissions * disable legacy mirror * try using registry cache * fix cache key * fix cache key * try out another arm image * cleanup * remove temporary override
1 parent 3419d8e commit ca1fa38

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

.github/workflows/build-docker.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,23 @@ env:
1818
jobs:
1919
build-docker:
2020
runs-on:
21-
- self-hosted
22-
- Linux
23-
- ${{ matrix.runner }}
24-
21+
- codebuild-defguard-gateway-runner-${{ github.run_id }}-${{ github.run_attempt }}
22+
image:${{ matrix.os }}
23+
instance-size:${{ matrix.size }}
2524
strategy:
2625
matrix:
27-
cpu: [arm64, amd64, arm/v7]
2826
include:
29-
- cpu: arm64
30-
runner: ARM64
27+
- os: arm-3.0
28+
size: xlarge
29+
cpu: arm64
3130
tag: arm64
32-
- cpu: amd64
33-
runner: X64
31+
- os: ubuntu-7.0
32+
size: xlarge
33+
cpu: amd64
3434
tag: amd64
35-
- cpu: arm/v7
36-
runner: ARM
35+
- os: arm-3.0
36+
size: xlarge
37+
cpu: arm/v7
3738
tag: armv7
3839

3940
permissions:
@@ -55,10 +56,6 @@ jobs:
5556

5657
- name: Set up Docker Buildx
5758
uses: docker/setup-buildx-action@v3
58-
with:
59-
buildkitd-config-inline: |
60-
[registry."docker.io"]
61-
mirrors = ["dockerhub-proxy.teonite.net"]
6259

6360
- name: Build container
6461
uses: docker/build-push-action@v5
@@ -68,8 +65,10 @@ jobs:
6865
provenance: false
6966
push: true
7067
tags: "${{ env.GHCR_REPO }}:${{ github.sha }}-${{ matrix.tag }}"
71-
cache-from: type=gha
72-
cache-to: type=gha,mode=max
68+
cache-from: |
69+
type=registry,ref=${{ env.GHCR_REPO }}:cache-${{ matrix.tag }}
70+
type=registry,ref=${{ env.GHCR_REPO }}:cache-${{ matrix.tag }}-${{ github.ref_name }}
71+
cache-to: type=registry,mode=max,ref=${{ env.GHCR_REPO }}:cache-${{ matrix.tag }}-${{ github.ref_name }}
7372

7473
- name: Scan image with Trivy
7574
uses: aquasecurity/[email protected]

0 commit comments

Comments
 (0)