Creating a Tibit Netconf Server Container

Copyright (c) 2020-2024, Ciena Corporation
  All rights reserved.

Overview
--------

This document provides instructions for creating a Tibit Netconf Server Docker
container from an installation package.

See the following additional documents for more information on the Tibit Netconf Server:
 * Tibit Tech Note TN0037 Tibit NETCONF/YANG User Guide & Release Notes


Requirements:
* Ubuntu Linux 20.04/22.04 (Focal Fossa/Jammy Jellyfish)
* docker-ce 19.03.5 (Docker Community Edition for Ubuntu)
* docker-compose 1.17.1-2



Build Environment Setup
-----------------------

This section provides instructions for preparing the build environment for creating
a containerized Tibit Netconf Server.

1) Update Ubuntu with the latest patches.

    sudo apt update && sudo apt upgrade

2) Install Docker Community Edition for Ubuntu. Do not use the docker apt package
distributed with Ubuntu. Instead, use the instructions at the following
link to install Docker Community Edition.
  * https://docs.docker.com/install/linux/docker-ce/ubuntu/


3) Install the docker-compose utility.

    sudo apt install docker-compose



Creating the Container
----------------------

Use the following steps to build and install the Tibit Netconf Server container.
Execute docker-compose commands from the docker/ directory.

1) Edit docker/NetconfInit.json to configure the Mongo Database settings. This file
provides the MongoDB connection information used by the Tibit Netconf Server container
for connectivity to the database.

The docker/NetconfInit.json file is referenced by docker-compose.yaml. Alternatively,
edit docker-compose.yaml to modify the bind mount to a file of your choosing.

2) Build the docker image used by the Tibit Netconf Server container using docker-compose.

    docker-compose build

3) Create, install, and start the container using docker-compose. Specify the '-d'
option to start the container in the background.

    docker-compose up -d



Managing the Tibit Netconf Server Container
-------------------------------------------

This section provides additional commands for managing the Tibit Netconf Server docker
container. Execute docker-compose commands from the docker/ directory.

* Start the Tibit Netconf Server container in the background

    docker-compose up -d

* Attaching to the Tibit Netconf Server container's console to display the Tibit Netconf
Server log output. See 'docker-compose logs' below for similar functionality.

    docker attach tibit-netconf

Note: Type 'ctrl-p ctrl-q' to detach from the container's console. Alternatively,
you can override the docker default settings to use 'ctrl-c' to detach.

For example,
$ cat ~/.docker/config.json
{
    "detachKeys": "ctrl-c"
}

* Tail the container's docker logs to display the Tibit Netconf Server log output

    docker-compose logs --follow tibit-netconf


* Stop the Tibit Netconf Server container

    docker-compose down
