diff --git a/.github/test/Dockerfile-alpine b/.github/test/Dockerfile-alpine new file mode 100644 index 00000000..6ae3a323 --- /dev/null +++ b/.github/test/Dockerfile-alpine @@ -0,0 +1,57 @@ +# Taken from https://github.com/linuxserver/docker-changedetection.io/blob/main/Dockerfile +# Test that we can still build on Alpine (musl modified libc https://musl.libc.org/) +# Some packages wont install via pypi because they dont have a wheel available under this architecture. + +FROM ghcr.io/linuxserver/baseimage-alpine:3.16 + +ARG BUILD_DATE +ARG VERSION +ARG CHANGEDETECTION_RELEASE +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="thespad" + +ENV PYTHONUNBUFFERED=1 + +RUN \ + apk add --update --no-cache --virtual=build-dependencies \ + cargo \ + g++ \ + gcc \ + libc-dev \ + libffi-dev \ + libxslt-dev \ + make \ + openssl-dev \ + py3-wheel \ + python3-dev \ + zlib-dev && \ + apk add --update --no-cache \ + libxslt \ + python3 \ + py3-pip && \ + echo "**** install changedetection.io ****" && \ + mkdir -p /app/changedetection && \ + if [ -z ${CHANGEDETECTON_RELEASE+x} ]; then \ + CHANGEDETECTON_RELEASE=$(curl -sX GET "https://api.github.com/repos/dgtlmoon/changedetection.io/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -s -o \ + /tmp/changedetection.tar.gz -L \ + "https://github.com/dgtlmoon/changedetection.io/archive/${CHANGEDETECTON_RELEASE}.tar.gz" && \ + tar xf \ + /tmp/changedetection.tar.gz -C \ + /app/changedetection/ --strip-components=1 && \ + rm /tmp/changedetection.tar.gz && \ + pip3 install -U pip wheel setuptools && \ + pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.16/ -r /app/changedetection/requirements.txt && \ + apk del --purge \ + build-dependencies && \ + rm -rf \ + /tmp/* \ + /root/.cache + +COPY root/ / + +EXPOSE 5000 + +VOLUME /config \ No newline at end of file diff --git a/.github/workflows/test-container-build.yml b/.github/workflows/test-container-build.yml index 7d59ad0b..04e1cfb1 100644 --- a/.github/workflows/test-container-build.yml +++ b/.github/workflows/test-container-build.yml @@ -43,6 +43,17 @@ jobs: version: latest driver-opts: image=moby/buildkit:master + - name: Test that the docker containers can build (musl via alpine check) + id: docker_build + uses: docker/build-push-action@v2 + # https://github.com/docker/build-push-action#customizing + with: + context: ./ + file: ./.github/test/Dockerfile-alpine + platforms: linux/amd64,linux/arm64, + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + - name: Test that the docker containers can build id: docker_build uses: docker/build-push-action@v2 @@ -53,3 +64,4 @@ jobs: platforms: linux/arm/v7,linux/arm/v6,linux/amd64,linux/arm64, cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache +