Skip to content

Commit

Permalink
chore: update Dockerfile and workflow labels and build-args
Browse files Browse the repository at this point in the history
  • Loading branch information
JGiola committed Mar 17, 2022
1 parent 0a3d15e commit a6baacc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test-build-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ jobs:
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
labels: |
org.opencontainers.image.documentation=https://docs.mia-platform.eu/docs/runtime_suite_tools/mlp/overview
org.opencontainers.image.vendor=Mia s.r.l.
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down Expand Up @@ -105,6 +109,9 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/amd64,linux/arm64
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
goreleaser:
name: Go Releaser
Expand Down
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ COPY go.sum .
RUN go mod download
RUN go mod verify

ARG version="DEV"
ARG date=""
ARG VERSION="DEV"
ARG BUILDTIME=""

COPY . .

ENV GO_LDFLAGS="-w -s -X github.com/mia-platform/mlp/internal/cli.BuildDate=${date} -X github.com/mia-platform/mlp/internal/cli.Version=${version}"
ENV GO_LDFLAGS="-w -s -X github.com/mia-platform/mlp/internal/cli.BuildDate=${BUILDTIME} -X github.com/mia-platform/mlp/internal/cli.Version=${VERSION}"
RUN GOOS=linux \
CGO_ENABLED=0 \
GOARCH=amd64 \
Expand All @@ -26,13 +26,6 @@ RUN GOOS=linux \

FROM alpine:3.15

ARG version="DEV"

LABEL maintainer="C.E.C.O.M <[email protected]>" \
name="mlp: cli for easier deployment of Mia-Platform Console projects" \
eu.mia-platform.url="https://www.mia-platform.eu" \
eu.mia-platform.version="${version}"

COPY --from=builder /build/mlp /usr/local/bin/

CMD ["mlp"]

0 comments on commit a6baacc

Please sign in to comment.