[Docker]Harbor修改subnet

1. Harbor默认subnet 172.21.0.0/16

docker network inspect harbor_harbor 
[
    {
        "Name": "harbor_harbor",
        "Id": "15a6c2b48fb12096bf54476a2b9901b6e7cf74001cc687f82c56b850b657674b",
        "Created": "2022-08-10T09:14:32.657651423+08:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.21.0.0/16",
                    "Gateway": "172.21.0.1"
                }
            ]
        },

2. 修改Harbor网络

# 关闭Harbor服务
docker -compose down
# 删除网络
docker network rm harbor_harbor
# 重建网络
docker network create --driver bridge --subnet=10.244.0.0/16 --gateway=10.244.0.1 harbor_harbor

3. 重新启动Harbor服务

docker-compose up -d
posted @ 2022-08-11 16:12  LeoShi2020  阅读(148)  评论(0)    收藏  举报