generated from steadybit/extension-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (33 loc) · 1 KB
/
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
# syntax=docker/dockerfile:1
##
## Build
##
FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.7 AS build
ARG TARGETOS TARGETARCH
ARG BUILD_WITH_COVERAGE
ARG BUILD_SNAPSHOT=true
ARG SKIP_LICENSES_REPORT=false
WORKDIR /app
COPY . .
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH goreleaser build --snapshot="${BUILD_SNAPSHOT}" --single-target -o extension
##
## Runtime
##
FROM alpine:3.20
LABEL "steadybit.com.discovery-disabled"="true"
ARG K6_VERSION=v0.51.0
ARG TARGETARCH=amd64
ADD https://github.com/grafana/k6/releases/download/$K6_VERSION/k6-$K6_VERSION-linux-$TARGETARCH.tar.gz /
RUN tar -xzf k6-$K6_VERSION-linux-$TARGETARCH.tar.gz && \
rm k6-$K6_VERSION-linux-$TARGETARCH.tar.gz && \
mv k6-$K6_VERSION-linux-$TARGETARCH/k6 /usr/local/bin/k6 && \
rm -rf k6-$K6_VERSION-linux-$TARGETARCH
RUN apk add zip
ARG USERNAME=steadybit
ARG USER_UID=10000
RUN adduser -u $USER_UID -D $USERNAME
USER $USERNAME
WORKDIR /
COPY --from=build /app/extension /extension
EXPOSE 8087 8088
ENTRYPOINT ["/extension"]