Skip to content

Deploying a "custom container"

Overview

This guide covers building and deploying a custom container to a CMTK device.

Prerequisites

  • CMTK device with Docker already setup and Portainer running
  • Container project

Create an archive

Change into your project directory. Make sure it contains all required files. In particular, the directory has to contain a Dockerfile. You can use the Python or Node.js examples for this. Create a tar archive with all the project files.

tar -czvf docker.tar.gz *

Building an image on the CMTK device

Probably the simplest way to deploy an image to a CMTK device is to upload your project archive to portainer and automatically build it.

Open Portainer and click on images then click on build a new image. Upload an image, select the tar.gz file you have created before and name it (e.g. mqtt-test in this example).

Build Image

Start the container

Now a container has be created using the installed image. Click on containers and then on add container. In the next dialog input the name of the image in the image field of the image section. Make sure to uncheck always pull image. Click on deploy the container in order to start the container.

Deploy Container

Container logs

You may open the logs of your container to make sure everything is working as expected.

Open Log