mirror of
https://gitea.com/docker/build-push-action.git
synced 2024-11-22 17:39:38 +01:00
99bea387ee
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
30 lines
815 B
Text
30 lines
815 B
Text
FROM --platform=${BUILDPLATFORM:-linux/amd64} tonistiigi/xx:golang AS xgo
|
|
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.13-alpine AS builder
|
|
|
|
ENV CGO_ENABLED 0
|
|
ENV GO111MODULE on
|
|
ENV GOPROXY https://goproxy.io
|
|
COPY --from=xgo / /
|
|
|
|
ARG TARGETPLATFORM
|
|
RUN go env
|
|
|
|
RUN apk --update --no-cache add \
|
|
build-base \
|
|
gcc \
|
|
git \
|
|
&& rm -rf /tmp/* /var/cache/apk/*
|
|
|
|
WORKDIR /app
|
|
|
|
ENV DIUN_VERSION="v4.4.0"
|
|
|
|
RUN git clone --branch ${DIUN_VERSION} https://github.com/crazy-max/diun .
|
|
RUN go mod download
|
|
RUN go build -ldflags "-w -s -X 'main.version=test'" -v -o diun cmd/main.go
|
|
|
|
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:latest
|
|
|
|
COPY --from=builder /app/diun /usr/local/bin/diun
|
|
COPY --from=builder /usr/local/go/lib/time/zoneinfo.zip /usr/local/go/lib/time/zoneinfo.zip
|
|
RUN diun --version
|