@@ -1,4 +1,4 @@
|
|||||||
Build Telegram Bot API as a docker container
|
# 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
|
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.
|
functionality for telegram bot services runed in Docker enviroment.
|
||||||
@@ -6,19 +6,19 @@ functionality for telegram bot services runed in Docker enviroment.
|
|||||||
Telegram Bot API repository https://github.com/tdlib/telegram-bot-api
|
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
|
How to use gude https://core.telegram.org/bots/api#using-a-local-bot-api-server
|
||||||
|
|
||||||
Before run
|
## Before run
|
||||||
|
|
||||||
Get you own application api id and hash on https://my.telegram.org
|
Get you own application api id and hash on https://my.telegram.org
|
||||||
Put it into tg-bot-api.env file variables.
|
Put it into `tg-bot-api.env` file variables.
|
||||||
|
|
||||||
Build and run
|
## Build and run
|
||||||
|
|
||||||
Just run ./build.sh script
|
Just run `./build.sh` script
|
||||||
Or build manualy: docker build -t <you image name> .
|
Or build manualy: `docker build -t <you image name> .`
|
||||||
And run it:
|
And run it:
|
||||||
docker run -p <host port>:8081 --name <you container name> --env=./tg-bot-api.env <you image name>
|
`docker run -p <host port>:8081 --name <you container name> --env=./tg-bot-api.env <you image name>`
|
||||||
|
|
||||||
Crossbuild
|
## Crossbuild
|
||||||
|
|
||||||
Use qemu and buildx if you need it.
|
Use qemu and buildx if you need it.
|
||||||
|
|
||||||
@@ -27,25 +27,27 @@ Get buidlx here https://github.com/docker/buildx
|
|||||||
Buildix documentation here https://docs.docker.com/buildx/working-with-buildx/
|
Buildix documentation here https://docs.docker.com/buildx/working-with-buildx/
|
||||||
|
|
||||||
Run image
|
Run image
|
||||||
docker run --privileged --rm docker/binfmt
|
`docker run --privileged --rm docker/binfmt`
|
||||||
Or (alternative)
|
Or (alternative)
|
||||||
docker run --privileged --rm multiarch/qemu-user-static:latest
|
`docker run --privileged --rm multiarch/qemu-user-static:latest`
|
||||||
|
|
||||||
Create profile (linux/arm/v7 used as example)
|
Create profile (linux/arm/v7 used as example)
|
||||||
docker buildx create --platform linux/arm/v7
|
`docker buildx create --platform linux/arm/v7`
|
||||||
|
|
||||||
Command returns profile name like <gallant_mahavira> use it for future configuration
|
Command returns profile name like <gallant_mahavira> use it for future configuration
|
||||||
|
|
||||||
Show profiles
|
Show profiles
|
||||||
|
```
|
||||||
docker buildx ls
|
docker buildx ls
|
||||||
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
|
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
|
||||||
<gallant_mahavira> * docker-container
|
<gallant_mahavira> * docker-container
|
||||||
gallant_mahavira0 unix:///var/run/docker.sock running linux/arm/v7*, linux/amd64, linux/386
|
gallant_mahavira0 unix:///var/run/docker.sock running linux/arm/v7*, linux/amd64, linux/386
|
||||||
default docker
|
default docker
|
||||||
default default running linux/amd64, linux/386
|
default default running linux/amd64, linux/386
|
||||||
|
```
|
||||||
|
|
||||||
Set used by default
|
Set used by default
|
||||||
docker buildx use <gallant_mahavira>
|
`docker buildx use <gallant_mahavira>`
|
||||||
|
|
||||||
Run crossbuild
|
Run crossbuild
|
||||||
docker buildx build -t <you image name> --platform linux/arm/v7 .
|
`docker buildx build -t <you image name> --platform linux/arm/v7 .`
|
||||||
Reference in New Issue
Block a user