Skip to content

Commit 016bb8b

Browse files
committed
switch from buildx to manual build steps
1 parent 59234dd commit 016bb8b

File tree

2 files changed

+54
-54
lines changed

2 files changed

+54
-54
lines changed

.github/workflows/docker-manual-triggered-test.yml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,41 @@ jobs:
1111
gcr-dockerhub-build-publish:
1212
runs-on: ubuntu-latest
1313
steps:
14-
-
15-
name: Checkout
14+
- name: Checkout
1615
uses: actions/checkout@v2
17-
-
18-
name: Set up QEMU
19-
uses: docker/setup-qemu-action@v1
20-
-
21-
name: Set up Docker Buildx
22-
uses: docker/setup-buildx-action@v1
23-
-
24-
name: Login to DockerHub
16+
- name: Update runc (temporary fix) # TODO: Remove step when https://github.com/actions/virtual-environments/issues/2658 fixed
17+
run: |
18+
sudo apt-get install libseccomp-dev
19+
git clone https://github.com/opencontainers/runc
20+
cd runc
21+
make
22+
sudo make install
23+
- name: Login to Docker Hub
2524
uses: docker/login-action@v1
2625
with:
2726
username: ${{ secrets.DOCKERHUB_USERNAME }}
2827
password: ${{ secrets.DOCKERHUB_TOKEN }}
29-
-
30-
name: Login to GitHub Container Registry
28+
- name: Login to GitHub Container Registry
3129
uses: docker/login-action@v1
3230
with:
3331
registry: ghcr.io
3432
username: ${{ github.repository_owner }}
3533
password: ${{ secrets.CR_PAT }}
36-
-
37-
name: Show Runners environment (debug)
34+
- name: Show Runners environment (debug)
3835
shell: bash
3936
run: export
40-
-
41-
name: Build and Push to GCR and Docker Hub
42-
uses: docker/build-push-action@v2
43-
with:
44-
context: .
45-
file: ./Dockerfile
46-
platforms: linux/amd64
47-
push: true
48-
tags: |
49-
${{ github.repository }}:${{ github.event.inputs.tags }}
50-
ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }}
37+
- name: Build Docker image and tag
38+
run: |
39+
docker build \
40+
--tag ${{ github.repository }}:latest \
41+
--tag ${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
42+
--tag ghcr.io/${{ github.repository }}:latest \
43+
--tag ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
44+
.
45+
- name: Push Docker image to Docker Hub
46+
run: |
47+
docker push ${{ github.repository }}:${{ github.event.inputs.tags }}
48+
- name: Push Docker image to GitHub Container Registry (GHCR)
49+
run: |
50+
docker push ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }}
51+
docker push ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }}

.github/workflows/docker-tag-triggered-prod.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,50 @@ jobs:
99
gcr-dockerhub-build-publish:
1010
runs-on: ubuntu-latest
1111
steps:
12-
-
13-
name: Checkout
12+
- name: Checkout
1413
uses: actions/checkout@v2
15-
-
16-
name: Set up QEMU
17-
uses: docker/setup-qemu-action@v1
18-
-
19-
name: Set up Docker Buildx
20-
uses: docker/setup-buildx-action@v1
21-
-
22-
name: Login to DockerHub
14+
- name: Update runc (temporary fix) # TODO: Remove step when https://github.com/actions/virtual-environments/issues/2658 fixed
15+
run: |
16+
sudo apt-get install libseccomp-dev
17+
git clone https://github.com/opencontainers/runc
18+
cd runc
19+
make
20+
sudo make install
21+
- name: Login to Docker Hub
2322
uses: docker/login-action@v1
2423
with:
2524
username: ${{ secrets.DOCKERHUB_USERNAME }}
2625
password: ${{ secrets.DOCKERHUB_TOKEN }}
27-
-
28-
name: Login to GitHub Container Registry
26+
- name: Login to GitHub Container Registry (GHCR)
2927
uses: docker/login-action@v1
3028
with:
3129
registry: ghcr.io
3230
username: ${{ github.repository_owner }}
3331
password: ${{ secrets.CR_PAT }}
34-
-
35-
name: Show Runners environment (debug)
32+
- name: Show Runners environment (debug)
3633
shell: bash
3734
run: export
38-
-
39-
name: Identify GitHub tag name
35+
- name: Identify GitHub tag name
4036
shell: bash
4137
# get tag name from runners environment 'GITHUB_REF' and then use bash substring
4238
# to strip out '+' symbol - required due to gcr not supporting this as a tag
4339
# name (docker hub does support it).
4440
# note if push is NOT triggered by tag then 'GITHUB_REF' will be the branch name.
4541
run: echo "##[set-output name=tag;]$(tag_name=${GITHUB_REF#refs/tags/} && echo "${tag_name//+/-}")"
4642
id: identify_tag
47-
-
48-
name: Build and Push to GCR and Docker Hub
49-
uses: docker/build-push-action@v2
50-
with:
51-
context: .
52-
file: ./Dockerfile
53-
platforms: linux/amd64
54-
push: true
55-
tags: |
56-
${{ github.repository }}:latest
57-
${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
58-
ghcr.io/${{ github.repository }}:latest
59-
ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
43+
- name: Build Docker image and tag
44+
run: |
45+
docker build \
46+
--tag ${{ github.repository }}:latest \
47+
--tag ${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
48+
--tag ghcr.io/${{ github.repository }}:latest \
49+
--tag ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
50+
.
51+
- name: Push Docker image to Docker Hub
52+
run: |
53+
docker push ${{ github.repository }}:latest
54+
docker push ${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
55+
- name: Push Docker image to GitHub Container Registry (GHCR)
56+
run: |
57+
docker push ghcr.io/${{ github.repository }}:latest
58+
docker push ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}

0 commit comments

Comments
 (0)