From b84949af64f1ab1df89d6807c9f12086f1b1839c Mon Sep 17 00:00:00 2001 From: Henning Bocklage Date: Fri, 5 Jun 2020 23:45:21 +0200 Subject: [PATCH] reworked ci --- .gitlab-ci.yml | 31 ++++++------------------------- Dockerfile | 4 +--- Dockerfile.arm32v7 | 36 ++++++++++++++++++++++++++++++++++++ Dockerfile.arm64v8 | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 28 deletions(-) create mode 100644 Dockerfile.arm32v7 create mode 100644 Dockerfile.arm64v8 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1c304f..63ff528 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,43 +4,24 @@ services: stages: - build - - post variables: IMAGE: registry.gitlab.com/bockiii/deemix-docker DOCKER_CLI_EXPERIMENTAL: enabled - ARCH_AMD: python3 - ARCH_ARM32: python3.armhf - ARCH_ARM64: python3.arm64 before_script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY -build_arm64: +build: stage: build - tags: - - arm64 - script: - - docker build --build-arg IMAGE_ARCH=$ARCH_ARM64 --pull -t $IMAGE:arm64v8 . + script: + - docker run --rm --privileged multiarch/qemu-user-static:register --reset + - docker build --pull -t $IMAGE:arm64v8 . - docker push $IMAGE:arm64v8 - -build_arm32v7: - stage: build - tags: - - armhf - script: - - docker build --build-arg IMAGE_ARCH=$ARCH_ARM32 --pull -t $IMAGE:armhf . + - docker build --pull -t $IMAGE:armhf . - docker push $IMAGE:armhf - -build_amd64: - stage: build - script: - - docker build --build-arg IMAGE_ARCH=$ARCH_AMD --pull -t $IMAGE:amd64 . + - docker build --pull -t $IMAGE:amd64 . - docker push $IMAGE:amd64 - -annotate: - stage: post - script: - docker manifest create $IMAGE $IMAGE:amd64 $IMAGE:armhf $IMAGE:arm64v8 - docker manifest annotate $IMAGE $IMAGE:armhf --os linux --arch armhf - docker manifest annotate $IMAGE $IMAGE:arm64v8 --os linux --arch arm64 diff --git a/Dockerfile b/Dockerfile index 040e39d..919fa32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -ARG IMAGE_ARCH - -FROM lsiobase/alpine.${IMAGE_ARCH}:3.9 +FROM lsiobase/alpine.python3:3.9 ENV PUID=1000 ENV PGID=1000 diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 new file mode 100644 index 0000000..fbd8750 --- /dev/null +++ b/Dockerfile.arm32v7 @@ -0,0 +1,36 @@ +FROM alpine AS builder + +# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261 +#ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz +ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v4.0.0-balena/qemu-4.0.0-balena-arm.tar.gz +RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1 + +FROM lsiobase/alpine.python3.armhf:3.9 + +# Add QEMU +COPY --from=builder qemu-arm-static /usr/bin + +ENV PUID=1000 +ENV PGID=1000 + +EXPOSE 9666 + +RUN \ + apk update && \ + apk add --no-cache \ + gcc \ + g++ \ + libffi-dev \ + python3-dev \ + make + +RUN \ + mkdir /deem && \ + chown abc:abc /deem && \ + rm -R /config && \ + ln -sf /deem/.config/deemix /config && \ + ln -sf /downloads /deem/deemix\ Music + +COPY root/ / + +VOLUME /downloads /config \ No newline at end of file diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 new file mode 100644 index 0000000..28f0b0b --- /dev/null +++ b/Dockerfile.arm64v8 @@ -0,0 +1,36 @@ +FROM alpine AS builder + +# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261 +#ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz +ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v4.0.0-balena/qemu-4.0.0-balena-aarch64.tar.gz +RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1 + +FROM lsiobase/alpine.python3.arm64:3.8 + +# Add QEMU +COPY --from=builder qemu-aarch64-static /usr/bin + +ENV PUID=1000 +ENV PGID=1000 + +EXPOSE 9666 + +RUN \ + apk update && \ + apk add --no-cache \ + gcc \ + g++ \ + libffi-dev \ + python3-dev \ + make + +RUN \ + mkdir /deem && \ + chown abc:abc /deem && \ + rm -R /config && \ + ln -sf /deem/.config/deemix /config && \ + ln -sf /downloads /deem/deemix\ Music + +COPY root/ / + +VOLUME /downloads /config \ No newline at end of file