Skip to content

Commit

Permalink
Support for linux/386, linux/arm64, linux/arm/v6 and `linux/arm…
Browse files Browse the repository at this point in the history
…/v7` platforms for docker image (#41)
  • Loading branch information
tarampampam authored Mar 23, 2021
1 parent 50d32dc commit d3f5acb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1 # Action page: <https://github.com/docker/setup-qemu-action>

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 # Action page: <https://github.com/docker/setup-buildx-action>

- name: Docker login in default registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_LOGIN }}" --password-stdin

Expand All @@ -79,24 +85,17 @@ jobs:

- name: Build image
run: |
docker build \
docker buildx build \
--platform "linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7" \
--tag "tarampampam/tinifier:${{ steps.values.outputs.version }}" \
--tag "tarampampam/tinifier:latest" \
--tag "ghcr.io/tarampampam/tinifier:${{ steps.values.outputs.version }}" \
--tag "ghcr.io/tarampampam/tinifier:latest" \
--build-arg "APP_VERSION=${{ steps.values.outputs.version }}" \
--file ./Dockerfile \
--push \
.
- name: Push image into default registry
run: |
docker push "tarampampam/tinifier:${{ steps.values.outputs.version }}"
docker push "tarampampam/tinifier:latest"
- name: Push image into ghcr.io registry
run: |
docker push "ghcr.io/tarampampam/tinifier:${{ steps.values.outputs.version }}"
docker push "ghcr.io/tarampampam/tinifier:latest"
godocs:
name: Renew docs and cache (${{ matrix.proxy }})
runs-on: ubuntu-20.04
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## v3.2.0

### Added

- Support for `linux/386`, `linux/arm64`, `linux/arm/v6` and `linux/arm/v7` platforms for docker image

## v3.1.0

### Changed
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# syntax=docker/dockerfile:1.2

# Image page: <https://hub.docker.com/_/golang>
FROM golang:1.16.0-alpine as builder
FROM --platform=${TARGETPLATFORM:-linux/amd64} golang:1.16.0-alpine as builder

# can be passed with any prefix (like `v1.2.3@GITHASH`)
# e.g.: `docker build --build-arg "APP_VERSION=v1.2.3@GITHASH" .`
Expand Down

0 comments on commit d3f5acb

Please sign in to comment.