From 19b9b1de12171fcf8a880788f45a49d1b8e2a60f Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sun, 27 Dec 2020 19:42:54 +0000 Subject: [PATCH] Add multiarch builds for raspberry pi. --- .github/workflows/build_image.yml | 9 +++++++-- README.md | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 8259744..6e0c017 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -1,7 +1,8 @@ name: Build Telegram API server on: + workflow_dispatch: schedule: - - cron: "0 2 */7 * *" + - cron: "0 2 */7 * *" jobs: build: runs-on: ubuntu-20.04 @@ -25,12 +26,16 @@ jobs: run: | echo "GITHUB_SHA=$(echo ${GITHUB_SHA::8})" >> $GITHUB_ENV echo "GITHUB_RUN_ID=$(echo ${GITHUB_RUN_NUMBER})" >> $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - name: Build Docker image run: | cd /home/runner/work/tdlib-telegram-bot-api-docker/tdlib-telegram-bot-api-docker/tdlib-telegram-bot-api export SET_DOCKER_REGISTRY="docker.pkg.github.com" export BASE_IMG_NAME="$SET_DOCKER_REGISTRY/lukaszraczylo/tdlib-telegram-bot-api-docker/telegram-api-server" docker login $SET_DOCKER_REGISTRY -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}" - docker build -t $BASE_IMG_NAME:${{ env.GITHUB_SHA }} -t $BASE_IMG_NAME:1.0.${{ env.GITHUB_RUN_ID }} -t $BASE_IMG_NAME:latest . + docker buildx build --platform linux/arm64,linux/amd64 -t $BASE_IMG_NAME:${{ env.GITHUB_SHA }} -t $BASE_IMG_NAME:1.0.${{ env.GITHUB_RUN_ID }} -t $BASE_IMG_NAME:latest . docker push "$BASE_IMG_NAME" docker push "$BASE_IMG_NAME:latest" \ No newline at end of file diff --git a/README.md b/README.md index e879e61..a4f9127 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Produce working, minimal Docker image for the Telegram Bot API server together w to use pipeline generating builds on the changes within the main repository managed by Telegram team. +This project does not modify any part of the [tdlib/telegram-bot-api](https://github.com/tdlib/telegram-bot-api) code. + ## Build schedule Build will be triggered automatically once a week to produce the latest version of the Telegram API Server. I would set it for the daily release but every build takes ~25 minutes and generates additional costs on my side. @@ -12,8 +14,12 @@ Images are versioned in format `1.0.x` where `x` is a build number. ## How to use the image +Images created within this project support following architectures: AMD64 and ARM64 + +Yes, it means you can run them on *Raspberry Pi 4* and above as well! 🥳 + ### Github authentication -You need to authenticate with github [see this thread](https://github.community/t/docker-pull-from-public-github-package-registry-fail-with-no-basic-auth-credentials-error/16358/87) to pull even the publicly available images. To do so you need to create [Personal Access Token](https://github.com/settings/tokens/new) with `read:packages` scope and use it to authenticate your docker client with the Github Docker Registry. +You need to authenticate with github ([see this thread](https://github.community/t/docker-pull-from-public-github-package-registry-fail-with-no-basic-auth-credentials-error/16358/87)) to pull even the publicly available images. To do so you need to create [Personal Access Token](https://github.com/settings/tokens/new) with `read:packages` scope and use it to authenticate your docker client with the Github Docker Registry. ``` docker login -u $GITHUB_USERNAME -p $GITHUB_TOKEN docker.pkg.github.com