I have just started new AWS t4g linux/arm64 instance and I am having a trouble running docker image on it.
I am using docker-compose.yml version 3.7 and I use gitlab CI runners to build the image. I have read the official documentation but its a bit confusing when it comes to what actually works, because I have tried several methods to build the image for linux/arm64 but none of it worked so far.
In this article, it says that --platform
is not supported in docker-compose.yml v3
and in official documentation it says buildx
should be included in 19.3 version (I assume it should work for 19.3 and newer, since my actual Docker engine version is 20.10.3), but nothing works.
This is my gitlab-ci.yml for building ELK (elastic stack), which fails since --platform
is not supported here I guess.
docker-build-elk:
# Official docker image.
image: docker/compose
stage: build
services:
- docker info
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
# pull dev image for caching
- docker pull ${CI_REGISTRY_IMAGE}:elk || true
- docker-compose -f ./elk/docker-compose.elastic.yml build --platform linux/arm64
after_script:
- docker push ${CI_REGISTRY_IMAGE}:elk
only:
- elk
I also tried to use ENVs with
- docker-compose -f ./elk/docker-compose.elastic.yml build --build-arg DOCKER_BUILDKIT=1 --build-arg COMPOSE_DOCKER_CLI_BUILD=1
Since it was reported as bug for v3, is there a way to get it working / or build image for arm64?