Skip to content

Commit

Permalink
provide docker args (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
hedhyw authored Jun 8, 2022
1 parent 349439a commit a7cc4eb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17.8'
go-version: '1.18.3'
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17.8'
go-version: '1.18.3'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down Expand Up @@ -54,3 +54,5 @@ jobs:
platforms: linux/amd64,linux/arm/v6,linux/386
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/gherkingen:latest,${{ secrets.DOCKERHUB_USERNAME }}/gherkingen:${{ steps.vars.outputs.tag }}
build-args: |
APPLICATION_VERSION=${{ steps.vars.outputs.tag }}
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_DOCKER_TAG=1.17.8-alpine3.15
ARG GOLANG_DOCKER_TAG=1.18.3-alpine3.15
ARG ALPINE_DOCKER_TAG=3.15

FROM golang:$GOLANG_DOCKER_TAG as builder
Expand All @@ -8,7 +8,8 @@ RUN apk update && apk upgrade && apk add --no-cache make
WORKDIR /build
COPY . .

RUN make build OUT_PATH=/build/bin/gherkingen
ARG APPLICATION_VERSION=unknown
RUN make build OUT_PATH=/build/bin/gherkingen VERSION=$APPLICATION_VERSION

FROM alpine:$ALPINE_DOCKER_TAG

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GOLANG_CI_LINT_VER:=v1.45.0
OUT_BIN?=${PWD}/bin/gherkingen
COVER_PACKAGES=${shell go list ./... | grep -Ev 'examples|model' | tr '\n' ','}
VERSION=${shell git describe --tags}
VERSION?=${shell git describe --tags}

build:
@echo "building ${VERSION}"
Expand Down

0 comments on commit a7cc4eb

Please sign in to comment.