From f5ebf44a9bbc1a4c6fbe2e15a27706a80f6a31ac Mon Sep 17 00:00:00 2001 From: maxb2 Date: Sun, 4 Apr 2021 09:51:04 -0500 Subject: [PATCH] remove buildx --- .github/workflows/build-stubs.yml | 35 ++++++++++++------------------- stubs/arm-compile.Dockerfile | 13 ------------ 2 files changed, 13 insertions(+), 35 deletions(-) delete mode 100644 stubs/arm-compile.Dockerfile diff --git a/.github/workflows/build-stubs.yml b/.github/workflows/build-stubs.yml index c2ac0f5..7fae5c5 100644 --- a/.github/workflows/build-stubs.yml +++ b/.github/workflows/build-stubs.yml @@ -54,38 +54,29 @@ jobs: platform: [linux/arm/v7, linux/arm64/v8] include: - platform: linux/arm/v7 - arch: armv7 + arch: arm32v7 output: linux-armv7 - platform: linux/arm64/v8 - arch: arm64 + arch: arm64v8 output: linux-arm64 steps: - name: Checkout code uses: actions/checkout@v2 - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - platforms: ${{ matrix.platform }} - - - name: Available platforms - run: echo ${{ steps.qemu.outputs.platforms }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - + - name: Enable Docker Experimental Features + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + - name: Build ${{ matrix.arch }} run: | cd stubs - docker buildx build -f arm-compile.Dockerfile \ - --platform ${{ matrix.platform }} \ - --build-arg OUTPUT=${{ matrix.output }} \ - --load -t stub:${{ matrix.arch }} . - APP=$(docker run --rm -it -d stub:${{ matrix.arch }}) - docker cp $APP:/usr/src/build/${{ matrix.output }} ./ - docker kill $APP + docker run --rm --platform ${{ matrix.platform }} -v "$PWD":/usr/src/myapp -w /usr/src/myapp ${{ matrix.arch }}/golang:1.16 go build -o ${{ matrix.output }} stub.go + echo >> ${{ matrix.output }} && echo '### CAXA ###' >> ${{ matrix.output }} - name: Upload artifacts uses: actions/upload-artifact@v2 diff --git a/stubs/arm-compile.Dockerfile b/stubs/arm-compile.Dockerfile deleted file mode 100644 index 0c9c25b..0000000 --- a/stubs/arm-compile.Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -ARG GO_VERSION='1.16' - -FROM golang:$GO_VERSION - -WORKDIR /usr/src/build - -COPY stub.go stub.go - -ARG OUTPUT=linux-arm - -RUN go build -o $OUTPUT stub.go && echo >> $OUTPUT && echo '### CAXA ###' >> $OUTPUT - -ENTRYPOINT ["/bin/bash"]