Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-root docker image version #338

Open
Anastasios89 opened this issue Dec 10, 2023 · 2 comments
Open

Non-root docker image version #338

Anastasios89 opened this issue Dec 10, 2023 · 2 comments

Comments

@Anastasios89
Copy link

Anastasios89 commented Dec 10, 2023

Hello everyone,

some systems run with security contexts, which means that the container cannot run with root privileges.

Could you please also offer a non-root version docker image on docker hub?

Best regards.

@EarthlingDavey
Copy link

AFAICT you can do the following in your own Dockerfile. It seems to work as expected.

FROM hipages/php-fpm_exporter AS build-fpm-exporter

# Non-root user
USER 101

@ffais
Copy link

ffais commented Oct 14, 2024

This is an example using nonroot google distroless image:

FROM golang:1.20.4 as builder

WORKDIR /go/src/github.com/hipages/php-fpm_exporter
COPY . .
RUN go mod download
RUN make build
RUN cp php-fpm_exporter /bin/php-fpm_exporter

FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=builder /bin/php-fpm_exporter /bin/php-fpm_exporter
EXPOSE     9253
ENTRYPOINT [ "/bin/php-fpm_exporter", "server" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants