-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (39 loc) · 1011 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# syntax=docker/dockerfile:1
##
## Build
##
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS build
ARG TARGETOS TARGETARCH
ARG NAME
ARG VERSION
ARG REVISION
ARG ADDITIONAL_BUILD_PARAMS
ARG SKIP_LICENSES_REPORT=false
WORKDIR /app
RUN apk add build-base
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY . .
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build \
-ldflags="\
-X 'github.com/steadybit/extension-kit/extbuild.ExtensionName=${NAME}' \
-X 'github.com/steadybit/extension-kit/extbuild.Version=${VERSION}' \
-X 'github.com/steadybit/extension-kit/extbuild.Revision=${REVISION}'" \
-o ./extension \
${ADDITIONAL_BUILD_PARAMS}
RUN make licenses-report
##
## Runtime
##
FROM alpine:3.21
LABEL "steadybit.com.discovery-disabled"="true"
ARG USERNAME=steadybit
ARG USER_UID=10000
RUN adduser -u $USER_UID -D $USERNAME
USER $USER_UID
WORKDIR /
COPY --from=build /app/extension /extension
COPY --from=build /app/licenses /licenses
EXPOSE 8080
ENTRYPOINT ["/extension"]