LoginSignup
5
7

More than 5 years have passed since last update.

DockerのgatewayのIPアドレスを変更

Last updated at Posted at 2016-08-09

環境

  • Ubuntu 16.04 LTS
  • Docker version 1.11.1

手順

Docker起動ファイルを編集

sudo su -
systemctl stop docker
vim /lib/systemd/system/docker.service

ExecStartに--bip=192.168.100.1/24を加える

[Service]
ExecStart=/usr/bin/docker daemon -H fd:// --bip=192.168.100.1/24

docker0を削除してからスタート

systemctl daemon-reload
ip link set dev docker0 down
systemctl start docker
# 確認
ip r

追伸

もっといい方法があれば教えていただきたいっす。

macの場合

Dockerアイコン > Preferences > Daemon > Advanced に以下のようにjson形式で記載

{
  "bip": "192.168.100.1/24"
}
5
7
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
7