Skip to content

Commit 53d1f78

Browse files
vm-builder,ci: pass target arch as vm-builder argument
1 parent ed7a748 commit 53d1f78

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/build-test-vm.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ env:
3131
IMG_POSTGRES_16_BULLSEYE: "neondatabase/vm-postgres-16-bullseye"
3232
# using image built in the same workflow
3333
IMG_DAEMON: "daemon:dev"
34+
TARGET_ARCH: "amd64"
3435

3536
defaults:
3637
run:
@@ -85,7 +86,7 @@ jobs:
8586

8687
- name: build ${{ needs.tags.outputs.vm-postgres-16-bullseye }}
8788
run: |
88-
./bin/vm-builder -src postgres:16-bullseye -spec tests/e2e/image-spec.yaml -dst ${{ needs.tags.outputs.vm-postgres-16-bullseye }} -daemon-image ${{ needs.tags.outputs.daemon }}
89+
./bin/vm-builder -src postgres:16-bullseye -spec tests/e2e/image-spec.yaml -dst ${{ needs.tags.outputs.vm-postgres-16-bullseye }} -daemon-image ${{ needs.tags.outputs.daemon }} -target-arch linux/${TARGET_ARCH}
8990
- name: docker push ${{ needs.tags.outputs.vm-postgres-16-bullseye }}
9091
run: |
9192
docker push ${{ needs.tags.outputs.vm-postgres-16-bullseye }}

.github/workflows/vm-example.yaml

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- cron: '42 4 * * 2' # run once a week
66
workflow_dispatch: # adds ability to run this manually
77

8+
env:
9+
TARGET_ARCH: amd64
10+
811
jobs:
912
vm-example:
1013
runs-on: ubuntu-latest
@@ -31,26 +34,26 @@ jobs:
3134
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
3235

3336
- name: build vm-alpine:3.16
34-
run: bin/vm-builder -src alpine:3.16 -dst neondatabase/vm-alpine:3.16
37+
run: bin/vm-builder -src alpine:3.16 -dst neondatabase/vm-alpine:3.16 -target-arch/${TARGET_ARCH}
3538
- name: push vm-alpine:3.16
3639
run: docker push -q neondatabase/vm-alpine:3.16
3740

3841
- name: build vm-ubuntu:22.04
39-
run: bin/vm-builder -src ubuntu:22.04 -dst neondatabase/vm-ubuntu:22.04
42+
run: bin/vm-builder -src ubuntu:22.04 -dst neondatabase/vm-ubuntu:22.04 -target-arch/${TARGET_ARCH}
4043
- name: push vm-ubuntu:22.04
4144
run: docker push -q neondatabase/vm-ubuntu:22.04
4245

4346
- name: build vm-debian:11
44-
run: bin/vm-builder -src debian:11 -dst neondatabase/vm-debian:11
47+
run: bin/vm-builder -src debian:11 -dst neondatabase/vm-debian:11 -target-arch/${TARGET_ARCH}
4548
- name: push vm-debian:11
4649
run: docker push -q neondatabase/vm-debian:11
4750

4851
- name: build vm-postgres:14-alpine
49-
run: bin/vm-builder -src postgres:14-alpine -dst neondatabase/vm-postgres:14-alpine
52+
run: bin/vm-builder -src postgres:14-alpine -dst neondatabase/vm-postgres:14-alpine -target-arch/${TARGET_ARCH}
5053
- name: push vm-postgres:14-alpine
5154
run: docker push -q neondatabase/vm-postgres:14-alpine
5255

5356
- name: build vm-postgres:15-alpine
54-
run: bin/vm-builder -src postgres:15-alpine -dst neondatabase/vm-postgres:15-alpine
57+
run: bin/vm-builder -src postgres:15-alpine -dst neondatabase/vm-postgres:15-alpine -target-arch/${TARGET_ARCH}
5558
- name: push vm-postgres:15-alpine
5659
run: docker push -q neondatabase/vm-postgres:15-alpine

0 commit comments

Comments
 (0)