Skip to content

Commit

Permalink
ci: multi arch docker support (#83)
Browse files Browse the repository at this point in the history
* GitHub Actions - Docker Multi-arch support

Includes entries to support buildx to allow build on the same image amd64 and arm64 platforms.

Ncessary to support Docker on Apple Silicon and Raspberry PI

* goreleaser docker multi arch support

Includes entries to support buildx to allow build on the same image amd64 and arm64 platforms.

Ncessary to support Docker on Apple Silicon and Raspberry PI

* test token for initial test

# Test tokens

- test token for initial test

* One Dockerfile for both platforms

One Dockerfile for both platforms

* include latest tag for multi-arch docker

include latest tag for multi-arch docker

* included all tags for docker multi arch build

* change back to achannarasappa repo

removed test commented

* change token back to production

* rollback docker hub org to achannarasappa

As requested, reverted back the docker usage from goticker/ticker to achannarasappa/ticker

Co-authored-by: Ani Channarasappa <git@ani.dev>
  • Loading branch information
junior and achannarasappa committed Feb 9, 2021
1 parent 214c9bd commit a3625ee
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@ on:
jobs:
release:
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Docker Login
uses: docker/login-action@v1
Expand Down
56 changes: 47 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,52 @@ brews:
description: "Terminal stock ticker with live updates and position tracking"
license: "GPLv3"
dockers:
-
goos: linux
goarch: amd64
image_templates:
- "achannarasappa/ticker:{{ .Tag }}"
- "achannarasappa/ticker:v{{ .Major }}"
- "achannarasappa/ticker:v{{ .Major }}.{{ .Minor }}"
- "achannarasappa/ticker:latest"
- image_templates: ["achannarasappa/ticker:{{ .Version }}-amd64"]
binaries: [ticker]
dockerfile: Dockerfile
use_buildx: true
build_flag_templates:
- "--platform=linux/amd64"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- image_templates: ["achannarasappa/ticker:{{ .Version }}-arm64v8"]
binaries: [ticker]
goarch: arm64
dockerfile: Dockerfile
use_buildx: true
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
docker_manifests:
- name_template: achannarasappa/ticker:{{ .Version }}
image_templates:
- achannarasappa/ticker:{{ .Version }}-amd64
- achannarasappa/ticker:{{ .Version }}-arm64v8
- name_template: achannarasappa/ticker:latest
image_templates:
- achannarasappa/ticker:{{ .Version }}-amd64
- achannarasappa/ticker:{{ .Version }}-arm64v8
- name_template: achannarasappa/ticker:{{ .Major }}
image_templates:
- achannarasappa/ticker:{{ .Version }}-amd64
- achannarasappa/ticker:{{ .Version }}-arm64v8
- name_template: achannarasappa/ticker:{{ .Major }}.{{ .Minor }}
image_templates:
- achannarasappa/ticker:{{ .Version }}-amd64
- achannarasappa/ticker:{{ .Version }}-arm64v8
- name_template: achannarasappa/ticker:{{ .Major }}.{{ .Minor }}.{{ .Patch }}
image_templates:
- achannarasappa/ticker:{{ .Version }}-amd64
- achannarasappa/ticker:{{ .Version }}-arm64v8
# snapcrafts:
# -
# id: ticker
Expand All @@ -77,4 +115,4 @@ dockers:
# confinement: strict
# apps:
# ticker:
# plugs: ["network"]
# plugs: ["network"]

0 comments on commit a3625ee

Please sign in to comment.