Skip to content

Commit 5947102

Browse files
committed
ci: migrate to docker_v2 for Goreleaser container builds
1 parent 86c023f commit 5947102

4 files changed

Lines changed: 19 additions & 27 deletions

File tree

.github/workflows/go.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
steps:
3232
- name: Checkout Repository
3333
uses: actions/checkout@v6
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v4
3436
- name: Login to GitHub Container Registry
3537
uses: docker/login-action@v4
3638
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
dist/
23

34
# vim swap files
45
.*.sw*

.goreleaser.yaml

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
version: 2
3+
14
project_name: external-dns-openstack-webhook
25
before:
36
hooks:
@@ -32,35 +35,19 @@ builds:
3235
- goos: darwin
3336
goarch: arm
3437

35-
dockers:
38+
dockers_v2:
3639
- ids:
3740
- external-dns-openstack-webhook
38-
image_templates:
39-
- ghcr.io/inovex/{{ .ProjectName }}:{{ .Version }}-amd64
40-
goos: linux
41-
goarch: amd64
4241
dockerfile: goreleaser.dockerfile
43-
build_flag_templates:
44-
- "--build-arg=BINARY_NAME={{ .ProjectName }}"
45-
- "--platform=linux/amd64"
46-
use: buildx
47-
- ids:
48-
- external-dns-openstack-webhook
49-
image_templates:
50-
- ghcr.io/inovex/{{ .ProjectName }}:{{ .Version }}-arm64
51-
goos: linux
52-
goarch: arm64
53-
dockerfile: goreleaser.dockerfile
54-
build_flag_templates:
55-
- "--build-arg=BINARY_NAME={{ .ProjectName }}"
56-
- "--platform=linux/arm64"
57-
use: buildx
58-
59-
docker_manifests:
60-
- name_template: "ghcr.io/inovex/{{ .ProjectName }}:{{ .Version }}"
61-
image_templates:
62-
- "ghcr.io/inovex/{{ .ProjectName }}:{{ .Version }}-amd64"
63-
- "ghcr.io/inovex/{{ .ProjectName }}:{{ .Version }}-arm64"
42+
platforms:
43+
- linux/amd64
44+
- linux/arm64
45+
images:
46+
- ghcr.io/inovex/{{ .ProjectName }}
47+
build_args:
48+
BINARY_NAME: "{{ .ProjectName }}"
49+
tags:
50+
- "v{{ .Version }}"
6451

6552
archives:
6653
- name_template: "{{ .ProjectName }}-{{ .Version }}.{{ .Os }}-{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}"

goreleaser.dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ ENV HOME=/
66
# Let's set some sane defaults to amekt
77
ENV OS_CLIENT_CONFIG_FILE=/etc/openstack/clouds.yaml
88
ENV OS_CLOUD=openstack
9-
COPY external-dns-openstack-webhook /external-dns-openstack-webhook
9+
10+
ARG TARGETPLATFORM
11+
COPY $TARGETPLATFORM/external-dns-openstack-webhook /external-dns-openstack-webhook
1012
USER 1000
1113
ENTRYPOINT ["/external-dns-openstack-webhook"]

0 commit comments

Comments
 (0)