5
4

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 5 years have passed since last update.

Ubuntu Docker インストールとproxyとsudo無し実行

Last updated at Posted at 2018-09-20

Docker install

$ curl -fsSL https://get.docker.com/ | sh
コマンドを確認
$ docker --version
$ docker version

proxyに対応させる

dockerのオプション付けるディレクトリ作成
$ sudo mkdir -p /etc/systemd/system/docker.service.d
$ cd /etc/systemd/system/docker.service.d/

編集

http-proxy.confの作成
$ sudo vi http-proxy.conf

[Service]
Environment="HTTP_PROXY=http://[id]:[passwd]@[proxy.example]:[port]/"

https-proxy.confの作成
$ sudo cp http-proxy.conf https-proxy.conf
$ sudo vi https-proxy.conf

[Service]
Environment="HTTPS_PROXY=http://[id]:[passwd]@[proxy.example]:[port]/"

HTTP ▷ HTTPSにするだけ

反映

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

sudo無しでDocker動かしたい

UbuntuでDockerの環境整えたのだが
sudo無いとコマンド実行できず

Macでは、sudo無しなのでうざったい。
そこでsudo無しでも行けるよってのは、公式にも書いてある。

dockerのグループ作成

$ sudo groupadd docker
これは、既に作成している。

ユーザーをdockerに追加

$ sudo gpasswd -a $USER docker
ここで設定は完了

しかしこのままでは、まだsudoが必要
再起動すればおそらく問題ないが面倒...

shellを更新

$ newgrp docker
これで行ける。

5
4
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
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?