This guide assumes the following:
You can either run Docker on the same VM that you are using for maven and other development work, or you can install Docker in its own VM. There is less network configuration to be done if Docker is installed in the same VM as your maven builds. In this guide, we will look at installing Docker in the same VM that you are using for builds.
The Docker service is installed on Linux from the package manager. It is available for most Linux distributions.
Install on Ubuntu: sudo apt-get install docker.io
Install on Centos/Redhat: sudo yum install docker
sudo systemctl enable docker
sudo systemctl start docker
sudo service docker start
Note: This could be considered a security risk because your account will basically have root access when it’s in the docker group
sudo groupadd docker
sudo usermod -aG docker $USER
sudo shutdown now -r
You can test your install by running docker version
sudo mkdir /etc/systemd/system/docker.service.d
[Service] Environment=”HTTP_PROXY=<put proxy address here>/” |
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo service docker restart
We normally use the docker-compose utility to bring up the appc Docker images.
It can be installed with: sudo apt-get install docker-compose
Depending on your Linux version and repository setup, docker-compose may not be available from the package manager.
sudo pip install docker-compose
sudo apt-get install python-pip
You need to make sure that you have an entry in your maven “settings.xml” file for your local maven repository. This way, when you run the Docker build, it will be able to download the appc installers from your local computer instead of going out to nexus server.
<repository> <id>local-maven</id> <name>local-maven</name> <url>file:///home/<Linux user id>/.m2/repository</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>local-maven</id> <name>local-maven</name> <url>file:///home/<Linux user id>/.m2/repository</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> |
The appc deployment project contains the maven files which will build the Docker image.
Clone this repository. (git clone
https://gerrit.onap.org/r/appc/deployment)
Our appc image is based on the ccsdk odlsli Docker image. So we need to download this before building the appc Docker image.
docker login nexus3.onap.org:10001
docker pull nexus3.onap.org:10001/onap/ccsdk-odlsli-alpine-image:0.4.1 (For Dublin Release)
docker tag nexus3.onap.org:10001/onap/ccsdk-odlsli-alpine-image:0.4.1 onap/ccsdk-odlsli-alpine-image:0.4.1
mvn clean install
mvn clean install -P docker
The command docker images
will show all the Docker images that you have on your system. You should see an image called “onap/appc-image” that was created recently (when you ran the build).
Note: Starting up the Docker containers from behind a proxy server usually does not work. We have had several experimental methods to make it work, but none have proven to be reliable.
docker-compose up -d
docker-compose logs
command to see the startup log.Opening the Opendaylight api doc explorer
| Shows the statup log for the containers. This is a good way to check if startup is complete. |
| Shows all running Docker containers |
| Shows all running and stopped Docker containers |
| Stops a running Docker container |
| Deletes a Docker container and its associated volume (does not delete the Docker image that was used to bring up the container) |
docker ps | while read a b c d e f g; do docker stop $a; done | This will stop all running Docker containers |
docker ps -a | while read a b c d e f g; do docker rm -v $a; done | This will delete all created Docker containers (will not delete the Docker image files) |
| Opens the bash shell in the running appc Docker container. The exit command will allow you to leave the Docker container. |
| Directly opens the opendaylight console that is running in the Docker container |
| List all of the Docker images that are on your system. Shows their name, version, id, size, and date. |
| Delete the Docker image off your system with the given image id |
Once the Docker containers are running, you can directly access the mysql database with this command: docker exec -it sdnc_db_container mysql -uroot -popenECOMP1.0