2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SynologyのNASでsudoなしでdockerコマンドを実行する

Posted at

root以外のユーザーにDockerコマンドの実行を許可したいが

いつもの方法で作業しようにもgroupaddコマンドが使えないので、いきなり入り口で止まってしまった。

~$ groupadd
-sh: groupadd: command not found

以下の手順でdockerグループを作成して、自分のアカウントをdockerグループに追加した

dockerグループを作成

$ sudo synogroup --add docker
Group Name: [docker]
Group Type: [AUTH_LOCAL]
Group ID:   [65536]
Group Members:

docker.sockの所有グループを変更

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

自分のアカウントhogeをdockerグループに追加

$ sudo synogroup --member docker $USER
Group Name: [docker]
Group Type: [AUTH_LOCAL]
Group ID:   [65536]
Group Members: 
0:[hoge]

一旦ログアウトしてログイン

$ exit
logout
$ ssh rainuser@192.168.1.10
$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?