Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


How to install features using Dockerfile?

asked 2015-11-23 10:16:35 -0700

razzam21 gravatar image

updated 2015-11-23 10:18:16 -0700

I am trying to create a Dockerfile that will automatically install opendaylight and configure it to work. I have all of the steps working except the last piece. I need install a list of features. I can do it if I log in but I try automate the process. What command can I run that will allow me to install the features?

Current Docker file:

FROM centos:6
MAINTAINER OpenDaylight Project <>

ADD opendaylight-3-candidate.repo /etc/yum.repos.d/

RUN yum update -y && yum install -y opendaylight

EXPOSE 162 179 1088 1790 1830 2400 2550 2551 2552 4189 4342 5005 5666 6633 6640 6653 7800 8000 8080 8101 8181 8383 12001

WORKDIR /opt/opendaylight

RUN sed -i -e 's:<is-learning-only-mode>false</is-learning-only-mode>:<is-learning-only-mode>true</is-learning-only-mode>:g' /opt/opendaylight/system/org/opendaylight/l2switch/main/main-config/0.2.0-Lithium/main-config-0.2.0-Lithium-config.xml
RUN sed -i -e 's:<is-install-dropall-flow>false</is-install-dropall-flow>:<is-install-dropall-flow>true</is-install-dropall-flow>:g' /opt/opendaylight/system/org/opendaylight/l2switch/main/main-config/0.2.0-Lithium/main-config-0.2.0-Lithium-config.xml
RUN sed -i -e 's:<is-proactive-flood-mode>true</is-proactive-flood-mode>:<is-proactive-flood-mode>false</is-proactive-flood-mode>:g' /opt/opendaylight/system/org/opendaylight/l2switch/arphandler/arphandler-config/0.2.0-Lithium/arphandler-config-0.2.0-Lithium-config.xml

CMD ["./bin/karaf", "server"]
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-11-23 12:39:38 -0700

jamoluhrsen gravatar image

The file you want to edit to install your features (l2switch stuff, like grmontpetit deduced) is in etc/org.apache.karaf.features.cfg. Add the features you want loaded to the featuresBoot line.

for example:


or, with sed:

sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,odl-l2switch-switch-ui/g" etc/org.apache.karaf.features.cfg
edit flag offensive delete publish link more


Thanks. This worked perfectly. I am now going to work on scaling down the container to make it is as small as possible.

razzam21 ( 2015-11-23 13:03:58 -0700 )edit

answered 2015-11-23 11:19:03 -0700


What do you plan to use ODL for depends on which feature you want to install. From what I am seeing, it looks like you want to use l2switch ? Then in that case feature:install odl-l2switch-switch should be good.

2 Things you might want to consider:

  • I would argue that some ports that you are opening might not be useful.
  • Starting karaf with ./bin/start will start karaf as a daemon.
edit flag offensive delete publish link more
Login/Signup to Answer


Asked: 2015-11-23 10:16:35 -0700

Seen: 494 times

Last updated: Nov 23 '15