reworked ci

This commit is contained in:
Henning Bocklage 2020-06-05 23:45:21 +02:00
parent f159189955
commit b84949af64
4 changed files with 79 additions and 28 deletions

View File

@ -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

View File

@ -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

36
Dockerfile.arm32v7 Normal file
View File

@ -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

36
Dockerfile.arm64v8 Normal file
View File

@ -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