From 35766a92d1cce04fed107c772c741cba58c227f3 Mon Sep 17 00:00:00 2001 From: nolim1t Date: Tue, 18 Aug 2020 19:29:53 +0700 Subject: [PATCH 1/8] Prepare buildx --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f76542d..57d3052 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,8 +11,9 @@ before_script: - apt update && apt install -y docker.io curl qemu-user-static - curl -L --output /docker-buildx "https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-amd64" - chmod a+x /docker-buildx - - mkdir -p /usr/lib/docker/cli-plugins/ - cp /docker-buildx /usr/lib/docker/cli-plugins/docker-buildx + - echo '{"experimental": true}' | sudo tee -a /etc/docker/daemon.json + - systemctl restart docker - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker buildx create --use From 433008d0588a4af8119411b28813e9a5e48dd9f4 Mon Sep 17 00:00:00 2001 From: nolim1t Date: Tue, 18 Aug 2020 19:34:14 +0700 Subject: [PATCH 2/8] Fix linting --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57d3052..77e26ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ before_script: - curl -L --output /docker-buildx "https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-amd64" - chmod a+x /docker-buildx - cp /docker-buildx /usr/lib/docker/cli-plugins/docker-buildx - - echo '{"experimental": true}' | sudo tee -a /etc/docker/daemon.json + - "echo '{\"experimental\": true}' | sudo tee -a /etc/docker/daemon.json" - systemctl restart docker - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker buildx create --use From acbbc5fac3f74b337f6588a9cb70bc0f43338195 Mon Sep 17 00:00:00 2001 From: nolim1t Date: Tue, 18 Aug 2020 19:41:42 +0700 Subject: [PATCH 3/8] Dont need to download it --- .gitlab-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 77e26ed..f74631a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,9 +9,6 @@ services: before_script: - apt update && apt install -y docker.io curl qemu-user-static - - curl -L --output /docker-buildx "https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-amd64" - - chmod a+x /docker-buildx - - cp /docker-buildx /usr/lib/docker/cli-plugins/docker-buildx - "echo '{\"experimental\": true}' | sudo tee -a /etc/docker/daemon.json" - systemctl restart docker - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY From d690163a7981eaa337e4c442c6620fb26269270f Mon Sep 17 00:00:00 2001 From: nolim1t Date: Wed, 19 Aug 2020 14:17:47 +0700 Subject: [PATCH 4/8] Remove sudo --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f74631a..3153abf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ services: before_script: - apt update && apt install -y docker.io curl qemu-user-static - - "echo '{\"experimental\": true}' | sudo tee -a /etc/docker/daemon.json" + - "echo '{\"experimental\": true}' | tee -a /etc/docker/daemon.json" - systemctl restart docker - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker buildx create --use From f310d9c6a5c5f58555538c6666e87ec53a2081e1 Mon Sep 17 00:00:00 2001 From: nolim1t Date: Wed, 19 Aug 2020 14:20:57 +0700 Subject: [PATCH 5/8] Wait 20 seconds before tryinh again --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3153abf..fbdc45f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ before_script: - apt update && apt install -y docker.io curl qemu-user-static - "echo '{\"experimental\": true}' | tee -a /etc/docker/daemon.json" - systemctl restart docker + - sleep 20 - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker buildx create --use From 72980e4db0f20364aaa08896aac765124eb77b44 Mon Sep 17 00:00:00 2001 From: nolim1t Date: Wed, 19 Aug 2020 14:25:20 +0700 Subject: [PATCH 6/8] Restart docker another way --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fbdc45f..7363e09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,8 @@ services: before_script: - apt update && apt install -y docker.io curl qemu-user-static - "echo '{\"experimental\": true}' | tee -a /etc/docker/daemon.json" - - systemctl restart docker - - sleep 20 + - /etc/init.d/docker restart + - sleep 30 - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker buildx create --use From b41e70328d5f3d4b324f7382d51549d62111015d Mon Sep 17 00:00:00 2001 From: BT Date: Wed, 19 Aug 2020 07:41:43 +0000 Subject: [PATCH 7/8] Update .gitlab-ci.yml --- .gitlab-ci.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7363e09..1d7a206 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: debian:buster-slim +image: jdrouet/docker-with-buildx:stable variables: DOCKER_HOST: tcp://docker:2375/ @@ -7,16 +7,11 @@ variables: services: - docker:dind -before_script: - - apt update && apt install -y docker.io curl qemu-user-static - - "echo '{\"experimental\": true}' | tee -a /etc/docker/daemon.json" - - /etc/init.d/docker restart - - sleep 30 - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker buildx create --use - build: stage: build script: - - docker buildx build --platform linux/arm64/v8,linux/amd64 --tag $CI_REGISTRY_IMAGE:$DOCKER_ENV_CI_COMMIT_REF_SLUG . + - apk add qemu + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker buildx create --use + - docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag $CI_REGISTRY_IMAGE:$DOCKER_ENV_CI_COMMIT_REF_SLUG . From 939a9e3163e5a1bf7d56f5e8d4660e2fbdc77375 Mon Sep 17 00:00:00 2001 From: BT Date: Wed, 19 Aug 2020 08:00:13 +0000 Subject: [PATCH 8/8] add docker info --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1d7a206..3242bec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,5 +13,6 @@ build: - apk add qemu - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker buildx create --use + - docker info - docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag $CI_REGISTRY_IMAGE:$DOCKER_ENV_CI_COMMIT_REF_SLUG .