From 73fb6b3dd21f440ea7024951ba5e8fca2d07abcb Mon Sep 17 00:00:00 2001 From: ezkrg Date: Fri, 8 Apr 2022 13:28:57 +0200 Subject: revive alpine3.12 for arm build --- .drone.yml | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----- Dockerfile | 9 ++++++++- 2 files changed, 63 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 81d5e21..b2f4d4e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,7 @@ steps: - echo $PASSWORD | docker login --username $USER --password-stdin - apk add --update --no-cache bash - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:cache --cache-to ezkrg/bitlbee-libpurple:cache -t ezkrg/bitlbee-libpurple:test --platform linux/amd64 $BUILD_ARGS . + - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:cache --cache-to ezkrg/bitlbee-libpurple:cache --tag ezkrg/bitlbee-libpurple:test --platform linux/amd64 --build-arg ALPINE_VERSION=3.15 $BUILD_ARGS . when: event: - push @@ -43,7 +43,57 @@ steps: - echo $PASSWORD | docker login --username $USER --password-stdin - apk add --update --no-cache bash - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:cache --cache-to ezkrg/bitlbee-libpurple:cache -t ezkrg/bitlbee-libpurple:$DRONE_TAG -t ezkrg/bitlbee-libpurple:latest --platform linux/amd64 $BUILD_ARGS . + - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:cache --cache-to ezkrg/bitlbee-libpurple:cache --tag ezkrg/bitlbee-libpurple:$DRONE_TAG --tag ezkrg/bitlbee-libpurple:latest --tag ezkrg/bitlbee-libpurple:alpine --platform linux/amd64 --build-arg ALPINE_VERSION=3.15 $BUILD_ARGS . + when: + event: + - tag + +--- +kind: pipeline +type: docker +name: alpine3.12 + +steps: + - name: docker + image: docker:dind + privileged: true + detach: true + command: [ "dockerd", "--host=tcp://0.0.0.0:2375" ] + + - name: test + image: ezkrg/buildx:latest + environment: + USER: + from_secret: DHU + PASSWORD: + from_secret: DHP + DOCKER_HOST: tcp://docker:2375 + commands: + - while ! docker info; do sleep 1; done + - docker buildx create --use --name docker --node docker --platform linux/amd64 --driver docker-container $DOCKER_HOST + - echo $PASSWORD | docker login --username $USER --password-stdin + - apk add --update --no-cache bash + - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) + - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:alpine3.12-cache --cache-to ezkrg/bitlbee-libpurple:alpine3.12-cache --tag ezkrg/bitlbee-libpurple:alpine3.12-test --platform linux/amd64,linux/arm64,linux/armhf --build-arg ALPINE_VERSION=3.12 $BUILD_ARGS . + when: + event: + - push + + - name: latest + image: ezkrg/buildx:latest + environment: + USER: + from_secret: DHU + PASSWORD: + from_secret: DHP + DOCKER_HOST: tcp://docker:2375 + commands: + - while ! docker info; do sleep 1; done + - docker buildx create --use --name docker --node docker --platform linux/amd64 --driver docker-container $DOCKER_HOST + - echo $PASSWORD | docker login --username $USER --password-stdin + - apk add --update --no-cache bash + - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) + - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:alpine3.12-cache --cache-to ezkrg/bitlbee-libpurple:alpine3.12-cache --tag ezkrg/bitlbee-libpurple:alpine3.12-$DRONE_TAG --tag ezkrg/bitlbee-libpurple:alpine3.12 --platform linux/amd64,linux/arm64,linux/armhf --build-arg ALPINE_VERSION=3.12 $BUILD_ARGS . when: event: - tag @@ -76,7 +126,7 @@ steps: - echo $PASSWORD | docker login --username $USER --password-stdin - apk add --update --no-cache bash - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:debian-cache --cache-to ezkrg/bitlbee-libpurple:debian-cache -t ezkrg/bitlbee-libpurple:debian-test --platform linux/amd64,linux/arm64,linux/armhf -f Dockerfile.debian $BUILD_ARGS . + - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:debian-cache --cache-to ezkrg/bitlbee-libpurple:debian-cache --tag ezkrg/bitlbee-libpurple:debian-test --platform linux/amd64,linux/arm64,linux/armhf -f Dockerfile.debian $BUILD_ARGS . when: event: - push @@ -96,7 +146,7 @@ steps: - echo $PASSWORD | docker login --username $USER --password-stdin - apk add --update --no-cache bash - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:debian-cache --cache-to ezkrg/bitlbee-libpurple:debian-cache -t ezkrg/bitlbee-libpurple:debian-$DRONE_TAG -t ezkrg/bitlbee-libpurple:debian-latest --platform linux/amd64,linux/arm64,linux/armhf -f Dockerfile.debian $BUILD_ARGS . + - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:debian-cache --cache-to ezkrg/bitlbee-libpurple:debian-cache --tag ezkrg/bitlbee-libpurple:debian-$DRONE_TAG --tag ezkrg/bitlbee-libpurple:debian --platform linux/amd64,linux/arm64,linux/armhf -f Dockerfile.debian $BUILD_ARGS . when: event: - tag @@ -135,6 +185,6 @@ depends_on: --- kind: signature -hmac: 4af294c1da51bd98b31d3c7cec96e571fd054461c406feddfe900be889a3594b +hmac: 17149ccfc7172082e06fec055ca9d336a8b5be1d1a66904e7bbe62d92d7546a8 ... diff --git a/Dockerfile b/Dockerfile index 9e7fa5f..91ac9a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM alpine:3.15 as base-image +ARG ALPINE_VERSION + +FROM alpine:${ALPINE_VERSION} as base-image FROM base-image as bitlbee-build @@ -280,12 +282,17 @@ FROM bitlbee-build as matrix-build ARG MATRIX=1 ARG MATRIX_VERSION +SHELL [ "/bin/bash", "-c" ] + +COPY matrix-e2e.c.patch /tmp/matrix-e2e.c.patch + RUN echo MATRIX=${MATRIX} > /tmp/status \ && if [ ${MATRIX} -eq 1 ]; \ then cd /tmp \ && git clone -n https://github.com/matrix-org/purple-matrix \ && cd purple-matrix \ && git checkout ${MATRIX_VERSION} \ + && if [ $(uname -m) == "armv7l" ]; then patch < ../matrix-e2e.c.patch; fi \ && make -j$(nproc --ignore 2) \ && make install \ && strip /usr/lib/purple-2/libmatrix.so; \ -- cgit v1.2.3