Giter VIP home page Giter VIP logo

Comments (9)

jlesage avatar jlesage commented on July 23, 2024

What do you mean exactly by non-root image ?

from docker-mkvtoolnix.

jr0dd avatar jr0dd commented on July 23, 2024

create a new user and have that user running the container. here's a couple snippets from relevant sections of code from here https://github.com/k8s-at-home/container-images/blob/main/base/ubuntu/Dockerfile

RUN \
  adduser kah \
  --uid 568 \
  --group \
  --system \
  --disabled-password \
  --no-create-home \
  && \
  mkdir -p /config \
  && chown -R kah:kah /config \
  && chmod -R 775 /config
ENV LANG en_US.UTF-8

USER kah

VOLUME [ "/config" ]

from docker-mkvtoolnix.

jlesage avatar jlesage commented on July 23, 2024

Ok, then the image is almost already non-root. Currently, the app itself (MKVToolNix) is running as non-root, along with most other supporting processes.

Note that I'm also working on the next version of the baseimage, in which s6-overlay is replaced by something simplier.

from docker-mkvtoolnix.

jr0dd avatar jr0dd commented on July 23, 2024

Very nice! It seems that a lot of images are using Tini over S6 these days. You did a great job on this btw. I did create a helm chart for this to use on k8s clusters. I'll wait to push it to my git if you're working on a new base image anyways.

from docker-mkvtoolnix.

jlesage avatar jlesage commented on July 23, 2024

Tini is good at running a single process. But it is not a process manager, which is something required for complex Docker image like this one, where multiple processes are running inside the container.

from docker-mkvtoolnix.

jernejml avatar jernejml commented on July 23, 2024

I have similar wish (non-root image). Is there any progress with new base image?

from docker-mkvtoolnix.

jlesage avatar jlesage commented on July 23, 2024

Yes, I'm hoping to start deploying apps based on the new baseimage in the following days/weeks.

To set expectations about non-root images: the new baseimage run all processes under a non-root user, except for the process monitor and init scripts, who still needs to be run as root. As mentioned earlier, the method used by containers under the k8s-at-home repo doesn't apply here. k8s-at-home applications are single binaries that don't need external services to function.

To be serious about all that, one should use Docker in rootless mode instead. With this mode, the whole Docker engine, along with containers, are not running as root. Docker uses a trick to remap users, meaning that the root user in the container is mapped to a non-root user on the host. See this interesting article: https://mohitgoyal.co/2021/04/14/going-rootless-with-docker-and-containers/.

from docker-mkvtoolnix.

jernejml avatar jernejml commented on July 23, 2024

Thank you for your quick reply.

Immediately after posting, I realized I actually don't really require non-root image. I only needed a different application user, and this could be achieved by passing env variables USER_ID/GROUP_ID. So, my bad, for not even carefully reading README page.

Still, your additional explanations (and the link) were very useful. Thanks again!

from docker-mkvtoolnix.

jlesage avatar jlesage commented on July 23, 2024

Perfect, so I think we can close this issue.

from docker-mkvtoolnix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.