OpenDaylight in a Docker
This is a quick guide to start a Docker container with OpenDaylight running on it.
Clone OpenDaylight integration repository
[egonzalez@localhost]$ git clone https://github.com/opendaylight/integration.gitMove to the directory where CentOS Dockerfile is saved.
[egonzalez@localhost]$ cd integration/packaging/docker/centos/| Build the new image, you can call it as your DockerHub name(in my case egonzalez90), so you can push it there later. | If you don\'t want to create a new image, you can use my image. This step will download and start the new container: docker run -d egonzalez90/opendaylight
[egonzalez@localhost centos]$ docker build -t egonzalez90/opendaylight .
Sending build context to Docker daemon 7.68 kB
Step 1 : FROM centos:7
Trying to pull repository docker.io/library/centos ... 7: Pulling from library/centos
1544084fad81: Pull complete
df0fc3863fbc: Pull complete
a3d54b467fad: Pull complete
a65193109361: Pull complete
Digest: sha256:a9237ff42b09cc6f610bab60a36df913ef326178a92f3b61631331867178f982
Status: Downloaded newer image for docker.io/centos:7
---> a65193109361
Step 2 : MAINTAINER OpenDaylight Project <[email protected]>
---> Running in d3f98f949b11
---> 81a1bad2e3a7
Removing intermediate container d3f98f949b11
Step 3 : ADD opendaylight-3-candidate.repo /etc/yum.repos.d/
---> 069a9c60878e
Removing intermediate container b9afb18311f3
Step 4 : RUN yum update -y && yum install -y opendaylight
---> Running in 559b3970235d
[[[ PACKAGE INSTALLATION STUFF ]]]
Complete!
---> 4003e5874b03
Removing intermediate container 559b3970235d
Step 5 : EXPOSE 162 179 1088 1790 1830 2400 2550 2551 2552 4189 4342 5005 5666 6633 6640 6653 7800 8000 8080 8101 8181 8383 12001
---> Running in 7defebe8b7e2
---> 9668a559bdac
Removing intermediate container 7defebe8b7e2
Step 6 : WORKDIR /opt/opendaylight
---> Running in 9298a116dd14
---> 5bf42f56e282
Removing intermediate container 9298a116dd14
Step 7 : CMD ./bin/karaf server
---> Running in e0a218941b15
---> c1a0db72dbbc
Removing intermediate container e0a218941b15
Successfully built c1a0db72dbbcOnce the image is built or downloaded, ensure you have it locally
Start a new container in a detached mode.
Check if the container is running with:
Now, check container information with docker inspect, we search for the IP address
| Now you know the container IP address, to login into karaf, first we need to download and install karaf client tool | Go to the following URL to download the package: http://www.apache.org/dyn/closer.lua/karaf/4.0.5/apache-karaf-4.0.5.tar.gz
Extract the files and move to the new directory
Execute the client authenticating with the container IP
Once karaf login succeed, install a few features like DLUX
Now you can login at the container IP with admin as username and password.
Best regards
Last updated
Was this helpful?