-
-
Notifications
You must be signed in to change notification settings - Fork 640
Docker rootless support #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker rootless support #311
Conversation
This has been possible by adding the possibility to bind the docker.sock to the user's current $XDG_RUNTIME_DIR, which is found in the user's .bashrc file, that he added after installing docker rootless, by following the instructions from the official documentation (https://docs.docker.com/engine/security/rootless/) to run the Docker Daemon as a non-root user. To achieve this, I made the following changes: 1) I added the DOCKER_HOST_ROOTLESS_PATH= variable inside the .env.sample file. 2) I updated in the two required lines of the docker-compose.yml file, the following: ${DOCKER_HOST_ROOTLESS_PATH:-/var/run/docker.sock} , instead of /var/run/docker.sock:/tmp/docker.sock:ro, so that this fixes the "Error: you need to share your Docker host socket with a volume at /var/run/docker.sock. Typically you should run your container with: '-v /var/run/docker.sock:/var/run/docker.sock:ro'" error when using docker rootless. 3) I attempted to update the MD5 of both the .env.sample & docker-compose.yml file [PLEASE CHECK] 4) I updated the usage text in the usage-fresh-start.sh file, so that the user can notice this optional flag: either "-dr" or "--docker-rootless" 5) I updated the update-env-new-site-variables.sh to update the .env DOCKER_HOST_ROOTLESS_PATH to set the user's current $XDG_RUNTIME_DIR, in case the "-dr" flag has been specified. Otherwise, this is left blank and no further action is done. 6) I updated the fresh-start.sh file to take into account the "-dr" flag. Shouldn't the "-dr" flag be specified, the programme should continue normally.
I will need to test it in order to merge this PR and might take a while on that. but thanks in advance. |
Kind of late but could update the other related scripts into this PR. thanks again! nice job!! |
While trying to set up the latest version on a standard DigitalOcean docker-compose image, I was running into the following error when running
Not knowing how to resolve that, I was able to get things set up by checking out the |
Also try running the help flag, so you can see all options available, and some explanation: $ ./fresh-start.sh --help |
@pathros I was just trying to get this proxy to work by following its instructions. I think there may be a bug in this PR in that if there is no |
You were right, there was a bug reported in a related repo: We miss the optional update script when updating the env variable, I just fixed that. So please try again without the rootless option: Would you mind to try again and give us a feedback? Thanks you very much for bringing this up. |
Well, I got my proxy working with |
I added support for Docker Rootless.
This has been possible by adding the possibility to bind the docker.sock to the user's current $XDG_RUNTIME_DIR, which is found in the user's .bashrc file, that he added after installing docker rootless, by following the instructions from the official documentation (https://docs.docker.com/engine/security/rootless/) to run the Docker Daemon as a non-root user.
I have tested this already on an Ubuntu 20.04.2 VPS where I set up Docker rootless according to the Docker rootless official documentation.