jikkou icon indicating copy to clipboard operation
jikkou copied to clipboard

Dockerfile should not define USER

Open singhbaljit opened this issue 1 year ago • 2 comments

Describe the bug The official Jikkou images define a USER in the Dockerfile. While it is usually a good practice to run containers with non-root, this is not great in CI/CD pipelines. We're unable install additional packages due to non-root user.

To Reproduce

  1. Launch the container
  2. Install a new package, i.e. apk add ...

Expected behavior Container should run as root by default so users can add additional packages in their CI pipelines

Runtime environment

  • Jikkou: 0.30.0

Additional context Since our pipelines run on Kubernetes, we can't easily change the user at runtime (unlike docker run ...).

singhbaljit avatar Nov 04 '23 00:11 singhbaljit

Hi @singhbaljit, you can still switch the USER to root when building new image from jikkou.

FROM streamthoughts/jikkou

USER root

RUN apk add --update curl && \
    rm -rf /var/cache/apk/*

fhussonnois avatar Nov 04 '23 10:11 fhussonnois

Yes, but that requires maintaining/hosting our own image. Using the official image directly is less overhead and the preferred solution.

singhbaljit avatar Nov 04 '23 12:11 singhbaljit