From 8d5dd363e5c60162b6b9b1cc75a36343e15bb9cc Mon Sep 17 00:00:00 2001 From: Gadgethm Date: Sun, 5 Jun 2022 13:47:28 -0600 Subject: [PATCH 1/3] Updated .goreleaser.yml to build docker images for multiple architectures. Docker image releases use manifests for multi-arch delivery --- .goreleaser.yml | 66 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 5e812dc..8c94db9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -34,8 +34,7 @@ changelog: - Merge branch dockers: - image_templates: - - 'skibish/ddns:{{ .Tag }}' - - 'skibish/ddns:latest' + - 'skibish/ddns:{{ .Tag }}-amd64' dockerfile: Dockerfile use: buildx build_flag_templates: @@ -46,3 +45,66 @@ dockers: - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" - "--platform=linux/amd64" +- image_templates: + - 'skibish/ddns:{{ .Tag }}-arm64' + dockerfile: Dockerfile + use: buildx + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.name={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/arm64" +- image_templates: + - 'skibish/ddns:{{ .Tag }}-armv6' + dockerfile: Dockerfile + use: buildx + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.name={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/arm/v6" +- image_templates: + - 'skibish/ddns:{{ .Tag }}-armv7' + dockerfile: Dockerfile + use: buildx + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.name={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/arm/v7" +- image_templates: + - 'skibish/ddns:{{ .Tag }}-i386' + dockerfile: Dockerfile + use: buildx + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.name={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/386" +docker_manifests: +- name_template: skibish/ddns:{{ .Tag }} + image_templates: + - skibish/ddns:{{ .Tag }}-amd64 + - skibish/ddns:{{ .Tag }}-arm64 + - skibish/ddns:{{ .Tag }}-armv6 + - skibish/ddns:{{ .Tag }}-armv7 + - skibish/ddns:{{ .Tag }}-i386 +- name_template: skibish/ddns:latest + image_templates: + - skibish/ddns:{{ .Tag }}-amd64 + - skibish/ddns:{{ .Tag }}-arm64 + - skibish/ddns:{{ .Tag }}-armv6 + - skibish/ddns:{{ .Tag }}-armv7 + - skibish/ddns:{{ .Tag }}-i386 \ No newline at end of file From b9f0d9af4366612b3f58fe656b99c6cfc3674ba3 Mon Sep 17 00:00:00 2001 From: Gadgethm Date: Mon, 6 Jun 2022 15:11:55 -0600 Subject: [PATCH 2/3] Added whitespace for easy reading --- .goreleaser.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 8c94db9..7ef90b4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -13,6 +13,7 @@ builds: goarm: - 6 - 7 + archives: - replacements: darwin: Darwin @@ -20,10 +21,13 @@ archives: windows: Windows 386: i386 amd64: x86_64 + checksum: name_template: 'checksums.txt' + snapshot: name_template: "{{ .Tag }}-next" + changelog: sort: asc filters: @@ -32,6 +36,7 @@ changelog: - '^test:' - Merge pull request - Merge branch + dockers: - image_templates: - 'skibish/ddns:{{ .Tag }}-amd64' @@ -93,6 +98,7 @@ dockers: - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" - "--platform=linux/386" + docker_manifests: - name_template: skibish/ddns:{{ .Tag }} image_templates: @@ -107,4 +113,4 @@ docker_manifests: - skibish/ddns:{{ .Tag }}-arm64 - skibish/ddns:{{ .Tag }}-armv6 - skibish/ddns:{{ .Tag }}-armv7 - - skibish/ddns:{{ .Tag }}-i386 \ No newline at end of file + - skibish/ddns:{{ .Tag }}-i386 From 8cb0410043c07580faabdb67c3d6eeb209120d2b Mon Sep 17 00:00:00 2001 From: Gadgethm Date: Tue, 7 Jun 2022 04:34:15 -0600 Subject: [PATCH 3/3] Updated to use appropriate binaries for each architecture in each docker file --- .goreleaser.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 7ef90b4..057e659 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -40,6 +40,8 @@ changelog: dockers: - image_templates: - 'skibish/ddns:{{ .Tag }}-amd64' + goos: linux + goarch: amd64 dockerfile: Dockerfile use: buildx build_flag_templates: @@ -52,6 +54,8 @@ dockers: - "--platform=linux/amd64" - image_templates: - 'skibish/ddns:{{ .Tag }}-arm64' + goos: linux + goarch: arm64 dockerfile: Dockerfile use: buildx build_flag_templates: @@ -64,6 +68,9 @@ dockers: - "--platform=linux/arm64" - image_templates: - 'skibish/ddns:{{ .Tag }}-armv6' + goos: linux + goarch: arm + goarm: 6 dockerfile: Dockerfile use: buildx build_flag_templates: @@ -76,6 +83,9 @@ dockers: - "--platform=linux/arm/v6" - image_templates: - 'skibish/ddns:{{ .Tag }}-armv7' + goos: linux + goarch: arm + goarm: 7 dockerfile: Dockerfile use: buildx build_flag_templates: @@ -88,6 +98,8 @@ dockers: - "--platform=linux/arm/v7" - image_templates: - 'skibish/ddns:{{ .Tag }}-i386' + goos: linux + goarch: 386 dockerfile: Dockerfile use: buildx build_flag_templates: