This repository was archived by the owner on Nov 30, 2023. It is now read-only.
This repository was archived by the owner on Nov 30, 2023. It is now read-only.
Use suid so the container does not need to be started as root or have sudo configured #488
Open
Description
The docker-debian.sh relies on the container being started as root or to have sudo
properly configured.
To get rid of this requirement, we can use the suid
bit so the script has permission to as root by itself. I made a small project to prove that it works, by using shc, the Shell Script Compiler, to make such thing work with shell scripts. See fixdockergid.
At the end, we could have a very less intrusive docker run
call to start the container:
docker run -u "$(id -u):$(id -g)" -v /var/run/docker.sock:/var/run/docker.sock ubuntu-with-fixdockergid
And the Dockerfile
can still have the USER vscode
as its last statement.