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