Инструменты пользователя

Инструменты сайта


synology:docker:add_group_user

Это старая версия документа!


Note: For the following steps it is assumed that you are logged in to your Synology NAS using ssh with an account that has sudo permissions.

First, let's create a new user group called docker:

❯ sudo synogroup --add docker

Now we can add our user to this newly created group. Assuming you are currently logged in with the user you wish to add, run the following:

❯ sudo synogroup --member docker $USER
Note: If you want to add another user or if you happen to run all these commands within a sudo -s session, replace $USER with the name of the user account you wish to add.

Lastly, let's modify who owns the docker.sock file, so that it now belongs to the docker user group we just created:

❯ sudo chown root:docker /var/run/docker.sock

That's it! For this to take effect you should log out and then back in again. In some cases you might have to restart your Synology NAS before it sticks. You should now be able to run docker and docker-compose commands without using sudo. Nice.

Screenshot-from-2021-07-28-15-52-03.opti-1.webpSo far this change seems to persist perfectly through reboots and even a system upgrade. I had originally done this while still running DSM6.x, and it's still running perfectly after upgrading to DSM7.

Enjoy!

synology/docker/add_group_user.1701771227.txt.gz · Последние изменения: 2023/12/05 13:13 — werwolf