7
9

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.

(2016/8) Docker 1.12 proxy設定(systemd)

Last updated at Posted at 2016-08-08

Dockerのプロキシ設定が1.12から変わったようです。

私のおすすめはドロップインフォルダを作成して、そこにファイルを置きます。

mkdir /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/docker.conf

※docker.service.dに.confで配置したファイルはドロップインファイルとして読み込まれます。

  • docker 1.11
mkdir -p /etc/systemd/system/docker.service.d/
vim /etc/systemd/system/docker.service.d/docker.conf
[Service]
Environment="HTTP_PROXY=http://${proxy_server}:8080/"
Environment="HTTPS_PROXY=http://${proxy_server}:8080/"
Environment="NO_PROXY=localhost,127.0.0.1"
Environment=TMPDIR=/var/tmp
Environment="DOCKER_OPTS=--insecure-registry ${private_repo}:5000" 
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS \
          $DOCKER_STORAGE_OPTIONS \
          $DOCKER_NETWORK_OPTIONS \
          $BLOCK_REGISTRY \
          $INSECURE_REGISTRY
  • docker 1.12
mkdir -p /etc/systemd/system/docker.service.d/
vim /etc/systemd/system/docker.service.d/docker.conf
[Service]
Environment="HTTP_PROXY=http://${proxy_server}:8080/"
Environment="HTTPS_PROXY=http://${proxy_server}:8080/"
Environment="NO_PROXY=localhost,127.0.0.1"
Environment=TMPDIR=/var/tmp
Environment="DOCKER_OPTS=--insecure-registry ${private_repo}:5000" 
ExecStart=
ExecStart=/usr/bin/dockerd $DOCKER_OPTS \
          $DOCKER_STORAGE_OPTIONS \
          $DOCKER_NETWORK_OPTIONS \
          $BLOCK_REGISTRY \
          $INSECURE_REGISTRY

しかもこれ docker upgradeしても自動的に/usr/bin/dockerdに書き換えてくれないのでupgradeする際にはご注意を。

7
9
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
7
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?