4
5

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.

dockerのデフォルトブリッジ(docker0)のIPアドレスを変更する

Last updated at Posted at 2017-08-24

はじめに

 Webを見ていると、docker0のIPアドレスを変更する様々な方法が見受けられます。docker.serviceの起動オプションを変更する、/etc/default/dockerにオプションを追記する等。
 しかし、バージョンが異なる為か、私の環境ではどれも動作しなかったので、こちらの環境で動いた方法を書いておきます。

環境

| バージョン
---|---
Ubuntu | 16.04 LTS
Docker | 17.06.1-ce

手順

1. /etc/docker/daemon.json に、IPアドレスの設定を記述する(以下はIPアドレスを 192.168.0.1 に設定する場合)。ファイルがない場合は新規に作成する。

{
  "bip": "192.168.0.1/24",
  "fixed-cidr": "192.168.0.0/24"
}

2. dockerを再起動する

service docker restart

参考

Customize the docker0 bridge

気になったこと

 この件と直接関係ないと思うんですが、VirtualBox上で動かすと、「intel_rapl: no valid rapl domains found in package 0」を表示後、再起動(?)するんですよね。物理マシン上では問題ないんですがなんでだろう...

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?