-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
34 lines (29 loc) · 996 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
ARG NODE_VERSION=23.6
ARG ALPINE_VERSION=3.21
ARG GOLANG_VERSION=1.23
ARG JAEGERUI_VERSION=v1.66.0
FROM scratch AS jaegerui-src
ARG JAEGERUI_REPO=https://github.com/jaegertracing/jaeger-ui.git
ARG JAEGERUI_VERSION
ADD ${JAEGERUI_REPO}#${JAEGERUI_VERSION} /
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS builder
WORKDIR /work/jaeger-ui
COPY --from=jaegerui-src / .
RUN npm install
WORKDIR /work/jaeger-ui/packages/jaeger-ui
RUN NODE_ENVIRONMENT=production npm run build
# failed to find a way to avoid legacy build
RUN rm build/static/*-legacy* && rm build/static/*.png
FROM scratch AS jaegerui
COPY --from=builder /work/jaeger-ui/packages/jaeger-ui/build /
FROM alpine AS compressor
RUN --mount=target=/in,from=jaegerui <<EOT
set -ex
mkdir -p /out
cp -a /in/. /out
cd /out
find . -type f -exec sh -c 'gzip -9 -c "$1" > "$1.tmp" && mv "$1.tmp" "$1"' _ {} \;
# stop
EOT
FROM scratch AS jaegerui-compressed
COPY --from=compressor /out /