clixon/docker/system
2019-02-12 13:38:23 +01:00
..
cleanup.sh Added docker/base as minimal clixon container and docker/system as full clixon system. 2019-02-11 14:17:29 +01:00
Dockerfile docker system push 2019-02-12 13:38:23 +01:00
Makefile.in docker system push 2019-02-12 13:38:23 +01:00
README.md Added RCLOG for redirecting restconf logs at tests; with-restconf error in example 2019-02-12 13:19:52 +01:00
start.sh More on clixon base container on Alpine 2019-02-12 11:11:04 +01:00
startsystem.sh Added docker/base as minimal clixon container and docker/system as full clixon system. 2019-02-11 14:17:29 +01:00

Clixon example container

This directory show how to build a "monolithic" clixon docker container exporting port 80 and contains the example application with both restconf, netconf, cli and backend.

Note that the container is built from scratch instead of using the base image. And it differs from the base image in that it builds the code from the local git locally (regardless of status and branch) wheras the base image pulls from remote github master branch.

Note that it could use the base image, and may in the future, see comments in the Dockerfile.

The directory contains the following files: cleanup.sh kill containers Dockerfile Docker build instructions Makefile.in "make docker" builds the container README.md This file start.sh Start containers startsystem.sh Internal start script copied to inside the container (dont run from shell)

How to build and start the container (called clixon-system):

  $ make docker
  $ ./start.sh 

The start.sh has a number of environment variables to alter the default behaviour:

  • PORT - Nginx exposes port 80 per default. Set PORT=8080 for example to access restconf using 8080.
  • DBG - Set debug. The clixon_backend will be shown on docker logs.
  • CONFIG - Set XML configuration file other than the default example.
  • STORE - Set running datastore content to other than default.

Example:

  $ DBG=1 PORT=8080 ./start.sh

Once running you can access it in different ways as follows: As CLI:

  $ sudo docker exec -it clixon-system clixon_cli

As netconf via stdin/stdout:

  $ sudo docker exec -it clixon-system clixon_netconf

As restconf using curl on exposed port 80:

  $ curl -G http://localhost/restconf

Or run tests:

  $ sudo docker exec -it clixon-system bash -c 'cd /clixon/clixon/test&& ./all.sh'

To check status and then kill it:

  $ sudo docker ps --all
  $ ./cleanup.sh 

You trigger the test scripts inside the container using make test.