Skip to content

Commit

Permalink
Merge pull request #21 from aleksandr-vin/patch-1
Browse files Browse the repository at this point in the history
Set numeric user to comply runAsNonRoot k8s policy
  • Loading branch information
mdawar authored Dec 9, 2021
2 parents 790d136 + 42d618b commit 57c9414
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.8-slim-buster

# Create a user and a group
RUN groupadd -r exporter && useradd -r -g exporter exporter
RUN groupadd -r exporter && useradd -r -g exporter exporter -u 999

# Create the /app directory and set the owner
RUN mkdir /app \
Expand All @@ -16,6 +16,6 @@ RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy the build context (defined in .dockerignore)
COPY . /app

USER exporter
USER 999

ENTRYPOINT ["python", "-m", "rq_exporter"]

0 comments on commit 57c9414

Please sign in to comment.