-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (22 loc) · 838 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARG GOLANG_IMAGE=ghcr.io/dopos/golang-alpine
ARG GOLANG_VERSION=v1.22.3-alpine3.20
ARG APP=showonce
FROM --platform=$BUILDPLATFORM ${GOLANG_IMAGE}:${GOLANG_VERSION} AS build
ARG APP
ARG GOPROXY TARGETOS TARGETARCH
RUN apk add --no-cache curl git make jq bash openssl
COPY . /src/$APP
WORKDIR /src/$APP
RUN --mount=type=cache,id=gobuild,target=/root/.cache/go-build \
--mount=type=cache,id=gomod,target=/go/pkg \
make -f Makefile.golang build PRG_DEST=$APP-static
FROM scratch
ARG APP
LABEL org.opencontainers.image.title="$APP" \
org.opencontainers.image.description="ShowOnce. One-time secrets service" \
org.opencontainers.image.authors="lekovr+github@gmail.com" \
org.opencontainers.image.licenses="Apache v2"
WORKDIR /
COPY --from=build /src/$APP/$APP-static /app
EXPOSE 8080
ENTRYPOINT [ "/app" ]