Dockerfile & manual for crossplatform telegram-bot-api server image build.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Terekhin Alexandr 9d44a21b16 Add 'README.md' 4 years ago
.gitignore Working version, env vars to file 4 years ago
Dockerfile Working version, env vars to file 4 years ago
README.md Add 'README.md' 4 years ago
build.sh Working version, env vars to file 4 years ago
tg-bot-api.env Working version, env vars to file 4 years ago

README.md

Build Telegram Bot API as a docker container

Use this Dockerfile if you need have a local telegram bot api server to provide webhooks and other extra functionality for telegram bot services runed in Docker enviroment.

Telegram Bot API repository https://github.com/tdlib/telegram-bot-api How to use gude https://core.telegram.org/bots/api#using-a-local-bot-api-server

Before run

Get you own application api id and hash on https://my.telegram.org Put it into tg-bot-api.env file variables.

Build and run

Just run ./build.sh script Or build manualy: docker build -t . And run it: docker run -p :8081 --name --env=./tg-bot-api.env

Crossbuild

Use qemu and buildx if you need it.

Install and configure qemu the way you OS requre that Get buidlx here https://github.com/docker/buildx Buildix documentation here https://docs.docker.com/buildx/working-with-buildx/

Run image docker run --privileged --rm docker/binfmt Or (alternative) docker run --privileged --rm multiarch/qemu-user-static:latest

Create profile (linux/arm/v7 used as example) docker buildx create --platform linux/arm/v7

Command returns profile name like <gallant_mahavira> use it for future configuration

Show profiles docker buildx ls NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS <gallant_mahavira> * docker-container
gallant_mahavira0 unix:///var/run/docker.sock running linux/arm/v7*, linux/amd64, linux/386 default docker
default default running linux/amd64, linux/386

Set used by default docker buildx use <gallant_mahavira>

Run crossbuild docker buildx build -t --platform linux/arm/v7 .