Skip to content

Latest commit

 

History

History
114 lines (71 loc) · 3.44 KB

docker_installation.md

File metadata and controls

114 lines (71 loc) · 3.44 KB

Docker Installation

This guide is for user that prefer to run the program with docker.

You can either use the official docker image or build it yourself.

This requires you to have Docker installed:

Option 1: Use the official image

Run

docker pull cnwan/cnwan-reader:v0.3.0

Now you can use the program as

docker run cnwan/cnwan-reader COMMAND

Follow the Docker Usage section to learn how to use it.

Option 2: Build it yourself

This method is most suitable for users that want to modify it or contribute to it.

Clone the project

Run the commands below to clone the project and navigate to its root directory:

git clone github.com/CloudNativeSDWAN/cnwan-reader
cd cnwan-reader

Optional: install Make

Now you need to build the program in order to use it.

Although you may use docker commands to do so, we recommend using the included Makefile as this will automate a lot of commands. To use the Makefile you need to have Make installed, which comes already pre-installed if you are a Unix/Linux/Mac user. If you are a Windows user, you can download the binaries from this page.

Build it

Execute:

make docker-build IMG=<repository/image-name:tag-name>

To avoid specifying the IMG parameter every time, you can modify the top of the Makefile to look like this:

# Image URL to use all building/pushing image targets
IMG ?= <repository/image-name:tag-name>

Now you can build the image just as

make docker-build

Now you can run the program as

docker run <repository/image-name:tag-name> COMMAND

Follow the Docker Usage section to learn how to use it.

Optional: Rename it

If you want to avoid specifying its full repository name, you can rename it.

Execute:

# If you are using the official docker image
docker rename cnwan/cnwan-reader cnwan-reader

# If you have built it yourself
docker rename <repository/image-name:tag-name> cnwan-reader

You can now run the program as just

docker run cnwan-reader COMMAND

Note that this is only for running it locally, as it won't be a valid repository name.

Push it

If you also wish to push the container to a container registry, make sure you are correctly logged in to it. Most of the times, this guide should do it, but we encourage you to read your container registry's official documentation to learn how to do that.

Your image name should respect the container registry format: i.e. if you are using DockerHub the name of your image should be something like your-username/image-name:tag-name. For other registries the full repository URL should be included, i.e. registry.com/your-username/image-name:tag-name.

Finally, to push it to a container registry, and supposing you have modified the Makefile as described in the previous sections:

make docker-push