MiKTeX / docker-miktex

the Docker image for running MiKTeX
41 stars 28 forks source link

`USER miktex` breaks ability to run commands as root #6

Closed nils-werner closed 5 years ago

nils-werner commented 6 years ago

None of the other Docker images I have encountered use

USER some_user

but simply run all commands as root. Is there a specific reason why you are not doing that, too?

I am trying to use this image for a GitLab CI build, and since I am not root I cannot run apt-get in my build scripts anymore.

KOLANICH commented 5 years ago

Any progress on it?

1kastner commented 5 years ago

Well, there are several projects which also switch the user, e.g. the docker Jupyter Notebook images. You can maybe simply create your own image and push it to dockerhub? It could be great if you share the link afterwards!

KOLANICH commented 5 years ago

It wouldn't be an official image and I would have to maintain it.

nils-werner commented 5 years ago

Well, there are several projects which also switch the user, e.g. the docker Jupyter Notebook images.

Yes, and they have massive problems because of it.

There really is no reason to manually set a USER in this otherwise very simple Docker image. If you want to run this as a specific user, you could simply use the --user flag when doing docker run

edocevoli commented 5 years ago

The commands are now executed as root.

To execute as the current user, you can pass options -e MIKTEX_GID=$(id -g) and -e MIKTEX_UID=$(id -u) to the Docker run command.