Here are the steps to get Jenkins up and running using Docker and Containerlab.

  • Open up your Kali or Linux distro
  • Create a containerlab file
touch cicd.clab.yml
  • Open the .yml file and add the following code
    • vim cicd.clab.yml
name: cicd_topo
      kind: linux
      image: jenkins/jenkins
        - 8080:8080

For some reason I had to restart the Docker service.

└─$ sudo service docker start
Starting Docker: docker.
  • Start containerlab using the yml file we just created
└─$ sudo containerlab deploy --topo cicd.clab.yml
INFO[0000] Containerlab v0.51.1 started
INFO[0000] Parsing & checking topology file: cicd.clab.yml
INFO[0000] Creating docker network: Name="clab", IPv4Subnet="", IPv6Subnet="2001:172:20:20::/64", MTU='ל'
WARN[0000] errors during iptables rules install: not available
INFO[0000] Could not read docker config: open /root/.docker/config.json: no such file or directory
INFO[0000] Pulling Docker image
INFO[0014] Done pulling
WARN[0014] Unable to init module loader: stat /lib/modules/ no such file or directory. Skipping...
INFO[0014] Creating lab directory: /home/kali/clab/clab-cicd_topo
INFO[0015] Creating container: "jenkins"
INFO[0015] Adding containerlab host entries to /etc/hosts file
INFO[0015] Adding ssh config for containerlab nodes
#NameContainer IDImageIPv4 Address

When I navigate to http://localhost:8080/ I get the following message.

  • Let’s shell into the docker image and get that password.
└─$ sudo docker exec -it clab-cicd_topo-jenkins sh
$ cat /var/jenkins_home/secrets/initialAdminPassword

I then clicked the Start using Jenkins button as shown above and we are in!