From a66c631651dce6c09b827c7df146c1d4a2e9e9ad Mon Sep 17 00:00:00 2001 From: ale Date: Thu, 20 Jun 2024 00:37:02 +0200 Subject: [PATCH] arm64 docker image --- .gitlab-ci.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18035d8..cdac7e1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,16 +3,30 @@ image: docker:dind services: - docker:dind +stages: + - build_amd64 + - build_arm64 + before_script: - docker -v -build image: +build_amd64: stage: build before_script: - - git submodule sync --recursive - git submodule update --init --recursive script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker compose build libretranslate - docker tag libretranslate $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api:latest - docker push $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api:latest + +build_arm64: + stage: build + before_script: + - git submodule update --init --recursive + - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker buildx build --platform arm64 --build-arg "with_models=true" -t libretranslate-arm64 ./LibreTranslate + - docker tag libretranslate-arm64 $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api-arm64:latest + - docker push $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api-arm64:latest