Once you have created a template of the Docker container for Alpine Linux, it will appear in the [End Device] toolbar.Drag and drop the Alpine Linux template onto your workspace. The docker pull command will automatically download the container image of the template from Docker Hub to the GNS3 VM. The container image will be downloaded only for the first time, and the log of executing docker pull command will be displayed on the console of GNS3.
I want to be able to run docker image in gns3. I installed docker that seems to be working correctly. I then created a new Docker Ubuntu computer on gns3. All went well, but when I try to start docker VM, I get this error:
I have added a Horizon Minion which runs as root in our DockerHub repository opennms/minion:26.1.1-gns3. It runs as root and the version number for the Minion needs to maintained in the config file. We can get rid of it as soon it is possible to run the Minion as non-root in GNS3 or they allow us to overwrite the user at runtime with something like docker run --user root .... Further information the GNS3 Forum Using Docker Images with non-root user.
So first I wanted to find how to do the link networking of container to create topologies that will help me test the scenarios I want.
When using docker standard tools it is possible to attach a container to multiple networks, you can use docker network create to create new networks and then run the container with the --net flag to specify the network you want. To get mutliple networks attached to a docker container (I tested with networks in bridge mode) you can attach secondary networks to a container with docker network connect [OPTIONS] NETWORK CONTAINER after the container was created.
But this last approach still made makes some noise in my head where the containers were linked through a bridge on the host network namespace and containers by default get configs like default GW and all of that. That reason made me think of a different strategy to actually manipulate the network namespaces myself to actually have the topology I really want. Then posibilities of doing complex topologies opens up.
Just starting a container with docker run --net none ...... starts a container with an isolated network namespace and only a loopback interface, then I have a blank page to attach interfaces and link them with other containers without the need to use bridges in the host networking.
A last thing which is pretty good is that, we can take this approach with any container image so each container can be started with an official FRR, go-bgp or bird container image to do more complex cases and routing protocols with very lightweight containers running on the host. And also very easy to clean up the environment after we are finished with the tests. This setup makes it pretty easy to recreate a topology saving extremely precious time to actually do networking research rathen than spending time creaing a topology again.
I will explain how to do it with a simple example with just ubuntu image containers and a simple topology and static routes as a proof of concept, however we could technically add as many interfaces and connections to other containers as we want.
In this setup we will end with 3 containers running 2 clients and 1 router. Also we will use a custom build container image based on ubuntu 20.04 I build which have multiple tools needed for network troubleshooting and this kind of tests. Here is the github repo link and the image dockerhub link
df19127ead