Set numeric user to comply runAsNonRoot k8s policy

When in k8s, container has `runAsNonRoot` policy and image has non-numeric user (nobody), then the deployment will fail as it cannot verify user is non-root.

Closes #406

Signed-off-by: Aleksandr Vinokurov <aleksandr.vin@gmail.com>
This commit is contained in:
Aleksandr Vinokurov 2021-11-16 17:48:56 +01:00 committed by GitHub
parent fae515f739
commit 258c8c0b2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@ ARG ARCH="amd64"
ARG OS="linux" ARG OS="linux"
COPY .build/${OS}-${ARCH}/statsd_exporter /bin/statsd_exporter COPY .build/${OS}-${ARCH}/statsd_exporter /bin/statsd_exporter
USER nobody USER 65534
EXPOSE 9102 9125 9125/udp EXPOSE 9102 9125 9125/udp
HEALTHCHECK CMD wget --spider -S "http://localhost:9102/metrics" -T 60 2>&1 || exit 1 HEALTHCHECK CMD wget --spider -S "http://localhost:9102/metrics" -T 60 2>&1 || exit 1
ENTRYPOINT [ "/bin/statsd_exporter" ] ENTRYPOINT [ "/bin/statsd_exporter" ]