Open crkinard opened 9 months ago
I just got the same. The issue might be with the release version, and rebuilding the plugin container might help.
The issue is resolved by enabling API version negotiation in the client.
//client, err := docker.NewClient("unix:///run/docker.sock", "v1.13.1", nil, nil)
client, err := docker.NewClientWithOpts(client.WithAPIVersionNegotiation(), docker.FromEnv)
I have a better chance of getting macvlan working then figuring out how to fix this heh,
@relet Is it possible that I clone your branch and build the fixed version myself? If yes, can you explain how? Thanks!
Yes, there are several branches that have the fix by now. In principle you can docker build locally to get the plugin, or push the result to a registry (eg github) and pull from there.
Can you verbosely explain how to do this on the CLI command by command? "In principle, you can docker build locally to get the plugin" For people like me that have never built anything for docker...
git clone https://github.com/devplayer0/docker-net-dhcp.git
cd docker-net-dhcp
git fetch origin pull/43/head:celerway
git checkout celerway
Switched to branch 'celerway'
git branch -a
* celerway
master
remotes/origin/HEAD -> origin/master
remotes/origin/dependabot/go_modules/github.com/containerd/containerd-1.5.18
remotes/origin/dependabot/go_modules/github.com/docker/docker-20.10.24incompatible
remotes/origin/dependabot/go_modules/golang.org/x/net-0.7.0
remotes/origin/dependabot/go_modules/golang.org/x/sys-0.1.0
remotes/origin/master
make create
docker plugin ls
ID NAME DESCRIPTION ENABLED
############ ghcr.io/devplayer0/docker-net-dhcp:golang Docker host bridge DHCP networking false
sudo docker plugin enable ghcr.io/devplayer0/docker-net-dhcp:golang
docker plugin ls
ID NAME DESCRIPTION ENABLED
############ ghcr.io/devplayer0/docker-net-dhcp:golang Docker host bridge DHCP networking true
sudo docker network ls
NETWORK ID NAME DRIVER SCOPE
############ bridge bridge local
############ config_default bridge local
############ dbrv100 ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64 local
############ dbrv200 ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64 local
############ dbrv300 ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64 local
############ dbrv350 ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64 local
############ dbrv400 ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64 local
Shows all your old docker-net-dhcp additions, we need to remove them :(
I first tried:
sudo docker network rm dbrv100
Error response from daemon: error while removing network: failed deleting Network: plugin "ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64" not found
So then I nuked them with
sudo docker network prune
WARNING! This will remove all custom networks not used by at least one container.
Are you sure you want to continue? [y/N] y
sudo docker network ls
NETWORK ID NAME DRIVER SCOPE
############ bridge bridge local
############ host host local
############ none null local
Then added them all back with the new compiled driver
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv100 dbrv100
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv200 dbrv200
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv300 dbrv300
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv350 dbrv350
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv400 dbrv400
sudo docker network ls
NETWORK ID NAME DRIVER SCOPE
############ bridge bridge local
############ dbrv100 ghcr.io/devplayer0/docker-net-dhcp:golang local
############ dbrv200 ghcr.io/devplayer0/docker-net-dhcp:golang local
############ dbrv300 ghcr.io/devplayer0/docker-net-dhcp:golang local
############ dbrv350 ghcr.io/devplayer0/docker-net-dhcp:golang local
############ dbrv400 ghcr.io/devplayer0/docker-net-dhcp:golang local
############ host host local
############ none null local
Now they are all back in action but all the containers still point to the old bridges 😭
docker container inspect genericcontainer001
you will see all the old ID's for the old networks...
I tried doing
sudo docker network disconnect dbrv100 genericcontainer001
sudo docker network connect dbrv100 genericcontainer001
This changed the network so I thought win!
Yet NetworkMode was still stuck with the old network and would fail on startup.
sudo docker container start genericcontainer001
Error response from daemon: could not find a network matching network mode ####...: network ####... not found
Error: failed to start containers: genericcontainer001
So then I ran compose
docker-compose.yml
version: '3.9'
services:
genericcontainer001:
container_name: genericcontainer001
hostname: genericcontainer001
mac_address: de:ad:be:ef:00:01
networks:
- dhcp
networks:
dhcp:
#mac_address: de:ad:be:ef:00:01 #(for docker engine verison 25)
name: dbrv100
external: true
docker compose up -d
It came back up with the right network without an issue yay!
Thanks to encbladexp in docker discord for helping me figure out the compile technique! Thanks to manjax in docker discord for telling me to use compose to bring up the system to fix the straggling networkmode issue.
Error response from daemon: NetworkDriver.CreateNetwork: failed to retrieve list of networks from Docker: Error response from daemon: client version 1.13.1 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version