From 2f41e92f2fe103186dd5983c2625e54947929404 Mon Sep 17 00:00:00 2001 From: dusdjhyeon Date: Tue, 16 Jul 2024 10:49:42 +0900 Subject: [PATCH] feat: migration base image Signed-off-by: dusdjhyeon --- Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e021b44..e255cce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,12 +17,18 @@ RUN go env RUN CGO_ENABLED=0 go build -buildvcs=false -o /output/chaos-exporter -v ./cmd/exporter/ # Packaging stage -# Image source: https://github.com/litmuschaos/test-tools/blob/master/custom/hardened-alpine/infra/Dockerfile -# The base image is non-root (have litmus user) with default litmus directory. -FROM litmuschaos/infra-alpine +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4 LABEL maintainer="LitmusChaos" -COPY --from=builder /output/chaos-exporter /litmus +ENV APP_DIR="/litmus" + +COPY --from=builder /output/chaos-exporter $APP_DIR/ +RUN chown 65534:0 $APP_DIR/chaos-exporter && chmod 755 $APP_DIR/chaos-exporter + +WORKDIR $APP_DIR +USER 65534 + CMD ["./chaos-exporter"] + EXPOSE 8080