From a92efee3a822161ae218f49584cea35a19e17701 Mon Sep 17 00:00:00 2001 From: Henning Bocklage Date: Thu, 11 Jun 2020 20:45:28 +0200 Subject: [PATCH] Rebase, port fix and changelog --- .gitlab-ci.yml | 31 ++++++++++++++---------- CHANGELOG.md | 6 +++++ Dockerfile | 44 +++++++++++++++++++++------------- Dockerfile.arm32v7 | 43 +++++++++++++++++++++------------ Dockerfile.arm64v8 | 42 +++++++++++++++++++++----------- README.md | 10 ++++---- docker-compose.yml | 2 +- manifest.yaml | 16 ------------- root/etc/services.d/deemix/run | 4 ++-- 9 files changed, 115 insertions(+), 83 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 manifest.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb64e70..2f67aa1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,26 +7,31 @@ stages: variables: IMAGE: registry.gitlab.com/bockiii/deemix-docker + IMAGE_TAG: latest DOCKER_CLI_EXPERIMENTAL: enabled before_script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - apk add --update curl && rm -rf /var/cache/apk/* + - export CI_JOB_TIMESTAMP=$(date --utc -Iseconds) build: stage: build script: - docker run --rm --privileged multiarch/qemu-user-static:register --reset - - docker build --pull -f Dockerfile.arm64v8 -t $IMAGE:arm64v8 . - - docker push $IMAGE:arm64v8 - - docker build --pull -f Dockerfile.arm32v7 -t $IMAGE:arm32v7 . - - docker push $IMAGE:arm32v7 - - docker build --pull -t $IMAGE:amd64 . - - docker push $IMAGE:amd64 - - set -e - - HOST_ARCH=$(uname -m) - - HOST_ARCH_ALIAS=$([[ "${HOST_ARCH}" == "x86_64" ]] && echo "amd64" || echo "${HOST_ARCH}") - - MANIFEST_TOOL_VERSION=$(curl -s https://api.github.com/repos/estesp/manifest-tool/releases/latest | grep 'tag_name' | cut -d\" -f4) - - curl -L https://github.com/estesp/manifest-tool/releases/download/$MANIFEST_TOOL_VERSION/manifest-tool-linux-$HOST_ARCH_ALIAS -o manifest-tool - - chmod +x manifest-tool - - ./manifest-tool push from-spec manifest.yaml \ No newline at end of file + - docker build --pull -f Dockerfile.arm64v8 --build-arg BUILDDATE=$CI_JOB_TIMESTAMP -t $IMAGE:arm64v8-${IMAGE_TAG} . + - docker build --pull -f Dockerfile.arm32v7 --build-arg BUILDDATE=$CI_JOB_TIMESTAMP -t $IMAGE:arm32v7-${IMAGE_TAG} . + - docker build --pull --build-arg BUILDDATE=$CI_JOB_TIMESTAMP -t $IMAGE:amd64-${IMAGE_TAG} . + - docker push $IMAGE:arm64v8-${IMAGE_TAG} + - docker push $IMAGE:arm32v7-${IMAGE_TAG} + - docker push $IMAGE:amd64-${IMAGE_TAG} + - docker manifest create "$IMAGE:${IMAGE_TAG}" + "$IMAGE:amd64-${IMAGE_TAG}" + "$IMAGE:arm32v7-${IMAGE_TAG}" + "$IMAGE:arm64v8-${IMAGE_TAG}" + - docker manifest annotate "$IMAGE:${IMAGE_TAG}" "$IMAGE:arm32v7-${IMAGE_TAG}" --os=linux --arch=arm --variant=v7 + - docker manifest annotate "$IMAGE:${IMAGE_TAG}" "$IMAGE:arm64v8-${IMAGE_TAG}" --os=linux --arch=arm64 --variant=v8 + # Push manifest to official registry + - docker manifest push "$IMAGE:${IMAGE_TAG}" + # Validate multi-arch manifest + - docker run --rm mplatform/mquery:v0.2 $IMAGE:${IMAGE_TAG} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..918bac3 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## 2020-06-11 +- First entry in the changelog. This is for the container only, not for deemix or any of it's components. +- Switched port to 6595 from 9666 (due to pyweb update). THIS SHOULD BE FIX NOW. I have hard-coded the port into the run parameter, so even if deemix itself will switch the port, you should always just have to map to 6595 +- Switched the base from a pre-build alpine-python3 build (that was pretty old) to the current alpine base with my own python installation. \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 919fa32..707a691 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,39 @@ -FROM lsiobase/alpine.python3:3.9 +FROM lsiobase/alpine:3.12 -ENV PUID=1000 -ENV PGID=1000 +ARG BUILDDATE -EXPOSE 9666 +LABEL \ + app.deemix.image.created="${BUILDDATE}" \ + app.deemix.image.url="https://gitlab.com/Bockiii/deemix-docker" \ + app.deemix.image.title="Docker image for Deemix" \ + app.deemix.image.description="Docker image for Deemix and the pyweb frontend" \ + maintainer="Bocki" RUN \ - apk update && \ - apk add --no-cache \ + echo "**** install build packages ****" && \ + apk add --no-cache --virtual=build-dependencies \ 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 + git \ + make && \ + echo "**** install packages ****" && \ + apk add --no-cache \ + py3-pip \ + python3 && \ + echo "**** setup directories ****" && \ + mkdir /deem && \ + chown abc:abc /deem && \ + rm -R /config && \ + ln -sf /deem/.config/deemix /config && \ + ln -sf /downloads /deem/deemix\ Music && \ + echo "**** clean up ****" && \ + rm -rf \ + /root/.cache \ + /tmp/* COPY root/ / -VOLUME /downloads /config +EXPOSE 6595 +VOLUME /downloads /config \ No newline at end of file diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index fbd8750..7f20673 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -1,36 +1,49 @@ 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 + +FROM lsiobase/alpine:arm32v7-3.12 # Add QEMU COPY --from=builder qemu-arm-static /usr/bin -ENV PUID=1000 -ENV PGID=1000 +ARG BUILDDATE -EXPOSE 9666 +LABEL \ + app.deemix.image.created="${BUILDDATE}" \ + app.deemix.image.url="https://gitlab.com/Bockiii/deemix-docker" \ + app.deemix.image.title="Docker image for Deemix" \ + app.deemix.image.description="Docker image for Deemix and the pyweb frontend" \ + maintainer="Bocki" RUN \ - apk update && \ - apk add --no-cache \ + echo "**** install build packages ****" && \ + apk add --no-cache --virtual=build-dependencies \ 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 + git \ + make && \ + echo "**** install packages ****" && \ + apk add --no-cache \ + py3-pip \ + python3 && \ + echo "**** setup directories ****" && \ + mkdir /deem && \ + chown abc:abc /deem && \ + rm -R /config && \ + ln -sf /deem/.config/deemix /config && \ + ln -sf /downloads /deem/deemix\ Music && \ + echo "**** clean up ****" && \ + rm -rf \ + /root/.cache \ + /tmp/* COPY root/ / +EXPOSE 6595 VOLUME /downloads /config \ No newline at end of file diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index 28f0b0b..d1702f4 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 @@ -1,36 +1,50 @@ 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 +FROM lsiobase/alpine:arm64v8-3.12 # Add QEMU COPY --from=builder qemu-aarch64-static /usr/bin -ENV PUID=1000 -ENV PGID=1000 +ARG BUILDDATE + +LABEL \ + app.deemix.image.created="${BUILDDATE}" \ + app.deemix.image.url="https://gitlab.com/Bockiii/deemix-docker" \ + app.deemix.image.title="Docker image for Deemix" \ + app.deemix.image.description="Docker image for Deemix and the pyweb frontend" \ + maintainer="Bocki" EXPOSE 9666 RUN \ - apk update && \ - apk add --no-cache \ + echo "**** install build packages ****" && \ + apk add --no-cache --virtual=build-dependencies \ 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 + git \ + make && \ + echo "**** install packages ****" && \ + apk add --no-cache \ + py3-pip \ + python3 && \ + echo "**** setup directories ****" && \ + mkdir /deem && \ + chown abc:abc /deem && \ + rm -R /config && \ + ln -sf /deem/.config/deemix /config && \ + ln -sf /downloads /deem/deemix\ Music && \ + echo "**** clean up ****" && \ + rm -rf \ + /root/.cache \ + /tmp/* COPY root/ / +EXPOSE 6595 VOLUME /downloads /config \ No newline at end of file diff --git a/README.md b/README.md index 967b6ef..7b2ec23 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ In order to run this container, you will have to exchange your previous image ta That should be it, everything else stays the same. You will only get updates if you switch to the new source! -ARM Builds are not working yet as I have to get used to the gitlab CI first. - # deemix-docker @@ -27,7 +25,7 @@ $ docker run -d --name Deemix \ -e PUID=1000 \ -e PGID=1000 \ -e ARL=1234567 \ - -p 9666:9666 \ + -p 6595:6595 \ registry.gitlab.com/bockiii/deemix-docker ``` @@ -46,7 +44,7 @@ services: - PGID=1000 - ARL=1234567 ports: - - 9666:9666 + - 6595:6595 ``` ### Updating Deemix @@ -65,11 +63,11 @@ The container will look for a new update in the Deemix repo on every start and w `-e ARL=1234567` - OPTIONAL: If you want Deemix to automatically log in for everyone who opens the website, provide your ARL token via this Environment variable. -`-p 9666:9666` - Port opened for the web interface. +`-p 6595:6595` - Port opened for the web interface. `registry.gitlab.com/bockiii/deemix-docker` - This container. -To access the web interface, go to http://YOURSERVERIP:9666 +To access the web interface, go to http://YOURSERVERIP:6595 ## Tags diff --git a/docker-compose.yml b/docker-compose.yml index 6cd46be..805f068 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,4 +11,4 @@ services: - PGID=1000 - ARL=1234567 ports: - - 9666:9666 \ No newline at end of file + - 6595:6595 \ No newline at end of file diff --git a/manifest.yaml b/manifest.yaml deleted file mode 100644 index d9db2aa..0000000 --- a/manifest.yaml +++ /dev/null @@ -1,16 +0,0 @@ -image: registry.gitlab.com/bockiii/deemix-docker:latest -manifests: - - image: registry.gitlab.com/bockiii/deemix-docker:amd64 - platform: - architecture: amd64 - os: linux - - image: registry.gitlab.com/bockiii/deemix-docker:arm32v7 - platform: - architecture: arm - os: linux - variant: v7 - - image: registry.gitlab.com/bockiii/deemix-docker:arm64v8 - platform: - architecture: arm64 - os: linux - variant: v8 \ No newline at end of file diff --git a/root/etc/services.d/deemix/run b/root/etc/services.d/deemix/run index 238c4bd..ddb30af 100644 --- a/root/etc/services.d/deemix/run +++ b/root/etc/services.d/deemix/run @@ -7,9 +7,9 @@ HOME=/deem if [ -f "/config/.arl" ]; then echo "[services.d] Starting with ARL" exec \ - s6-setuidgid abc python3 /deemix/server.py --serverwide-arl --host 0.0.0.0 + s6-setuidgid abc python3 /deemix/server.py 6595 --serverwide-arl --host 0.0.0.0 else echo "[services.d] Starting without ARL" exec \ - s6-setuidgid abc python3 /deemix/server.py --host 0.0.0.0 + s6-setuidgid abc python3 /deemix/server.py 6595 --host 0.0.0.0 fi \ No newline at end of file