From 9f446a4c9669775bfb88203a79d92611fd6a345e Mon Sep 17 00:00:00 2001 From: Bastian Meissner Date: Tue, 30 Nov 2021 23:06:50 +0100 Subject: [PATCH] Add multiarch Fix typo --- .circleci/config.yml | 49 ++++++++++++++++++++++---------------- .github/workflows/test.yml | 0 2 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index cd4ab26..2f37f67 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,29 +58,36 @@ jobs: - setup_remote_docker: version: 20.10.7 - run: - name: Load Docker image layer cache - command: | - set +o pipefail - docker load -i /caches/app.tar | true - - run: - name: Build application Docker image - command: | - docker build --cache-from=app -t app . - - run: - name: Save Docker image layer cache - command: | - mkdir -p /caches - docker save -o /caches/app.tar app - - save_cache: - key: v1-{{ .Branch }}-{{ epoch }} - paths: - - /caches/app.tar - - deploy: - name: Push application Docker image + name: Log in to Docker command: | docker login --username ${DOCKER_USER} --password ${DOCKER_PASSWORD} - docker tag app phntxx/dashboard:latest - docker push phntxx/dashboard:latest + - run: + name: Install docker buildx + command: | + apk add --no-cache curl + mkdir -p ~/.docker/cli-plugins + baseUrl="https://github.com/docker/buildx/releases/download" + fileName="buildx-v0.7.1.linux-amd64" + url="${baseUrl}/v0.7.1/${fileName}" + curl -sSL -o ~/.docker/cli-plugins/docker-buildx $url + chmod a+x ~/.docker/cli-plugins/docker-buildx + echo 'export DOCKER_CLI_EXPERIMENTAL="enabled"' >> $BASH_ENV + - run: + name: Prepare docker buildx + command: | + docker buildx install + docker version + docker buildx version + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker context create xbuilder + docker buildx create xbuilder --name xbuilder --driver-opt image=moby/buildkit:master --use + docker buildx inspect --bootstrap + - run: + name: Build all platforms + command: | + docker buildx build \ + --platform=linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 \ + -t phntxx/dashboard:latest --push . workflows: version: 2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e69de29