This little guide will help experienced SONM users to run custom applications on SONM suppliers. If you don’t know anything about SONM, better start with reading . docs You need to pass KYC3 , without it you can only run tasks from allowed list . As an example for this guide I will use , at the end you should be able to build and run it on SONM. SONM Community Telegram Bot Build an image Docker has great documentation and you can read this to get basic understanding of image build process and for writing Dockerfile. manual best practices So why do we need this guide if Docker has all the documentation? Yes, you can run any docker image on SONM, but if they use command line arguments to configure application runtime or pass arguments to deamon inside container, then you can’t use it. SONM tasks don’t accept arguments from command line and the only way to pass arguments into container is to use . environment variables Dockerfile Dockerfile contains list of commands that will prepare environment for your application, you can install anything you want/need here. Our bot is written in python, so we will use python base image from Docker Hub and pip to install needed python libraries. Here is Dockerfile from bot repo: FROM python:3-slimWORKDIR /usr/src/appCOPY . .RUN pip install python-telegram-bot seaborn pandas numpy scipyRUN chmod +x init.shENTRYPOINT ["./init.sh"] As I mentioned, we can pass arguments to application inside container only via environment variables, so we need to have some wrapper that will turn them into command line arguments. What does it mean? Usually to run docker image you need to set arguments for application from command line like this: $ docker run <someimage> [ARGS] To make this work for SONM we can write simple bash script that will get arguments from environment and append it to application. ENTRYPOINT bash script could look like this: #!/usr/bin/env bashexec python ./start.py "$COMMANDVAR" Now you can add arguments to environment variable $COMMANDVAR and they will be added as command line arguments to application. To play with docker environment variables you can use command like this: $ docker run -e "COMMANDVAR=--verbose" <someimage> For simplicity of an example scripts, they don’t have any validation of inputs, so they could be not safe to use as is. Our bot doesn’t use any command line arguments, but needs to set telegram token in configuration file. Here is init.sh from bot repo that uses $TOKEN variable from environment: #!/usr/bin/env bashif [ ! -z "$TOKEN" ]; thenecho "[+] Using provided Telegram token."cat config/telegram.json.template|sed "s/ADD_BOT_TOKEN_HERE/$TOKEN/g" > config/telegram.jsonelseecho "[-] No Telegram token provided."exit 1fiexec python ./start.py Application contains all necessary code, so you can just clone this repo and proceed further. SONM Community Telegram Bot $ git clone https://github.com/taskula/sonm-community-telegram-bot Build Build process is the same as for usual docker images. $ cd sonm-community-telegram-bot$ docker build -t sonm-community-telegram-bot . Run If you want to test with environment variables, you can just set them with -e flag. $ docker run -e TOKEN=YOUR_TOKEN_HERE sonm-community-telegram-bot Docker Hub Ok, we’ve built our image and we’re able to run it, now we need to make it accessible from outside. You can setup you own , Docker Hub or any other available registry. registry We will stick to , it’s the easiest way and you can use public or private repos for this, task files support both. Docker Hub Login to Docker Hub If you don’t have an account on Docker Hub, it’s time to register one. Once you have an account, you need to login from command line, just run: $ docker login Tag build Before uploading image to Hub, we need to tag it, I won’t go into detail about this process, you can read about it , so we will use most basic variation: here $ docker tag sonm-community-telegram-bot <DockerHubLogin>/sonm-community-telegram-bot Push image After setting the tag, we can just upload our image and proceed to write SONM task file. $ docker push <DockerHubLogin>/sonm-community-telegram-bot Automated builds If your project is open-sourced on GitHub, I suggest you to read about on Docker Hub, that will make the process of building new versions of image much easier. automated builds Running a task You must have an active deal to run task on, if you know nothing about SONM task files, read this . If you don’t know how to get a deal read this . Our application is pretty simple and task.yaml will look like: container:image: <DockerHubLogin>/sonm-community-telegram-botenv:TOKEN: add_your_telegram_token_here . This task file doesn’t cover all options that you can set, but you can find them in this example To run this task, you can just type: $ sonmcli task start <dealID> task.yaml Summary Congratulations, now you know how to run any custom application on SONM! If you have any questions, drop me a line.