# syntax=docker/dockerfile:1 ARG GO_VERSION="1.20" ARG ALPINE_VERSION="3.18" ARG XX_VERSION="1.2.1" FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS base COPY --from=xx / / ENV CGO_ENABLED=0 RUN apk add --no-cache file git WORKDIR /src FROM base AS version ARG GIT_REF RUN --mount=target=. </dev/null || cp /artifacts/* /out/ sha256sum -b diun_* > ./checksums.txt sha256sum -c --strict checksums.txt EOT FROM scratch AS release COPY --link --from=releaser /out / FROM alpine:${ALPINE_VERSION} RUN apk --update --no-cache add ca-certificates openssl COPY --from=build /usr/bin/diun /usr/local/bin/diun ENV PROFILER_PATH="/profiler" \ DIUN_DB_PATH="/data/diun.db" VOLUME [ "/data" ] ENTRYPOINT [ "diun" ] CMD [ "serve" ]