From 1951b39909d2929ea8923749f388d699e7afce80 Mon Sep 17 00:00:00 2001 From: reconman Date: Sun, 12 May 2024 13:50:06 +0200 Subject: [PATCH 1/5] Test python 3.12 --- .github/workflows/build-docker-image.yml | 6 +----- Docker/PlexAniSync/Dockerfile | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 3a55ac7..7c4cacf 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -40,11 +40,7 @@ jobs: echo "DOCKER_IO=true" >> $GITHUB_ENV fi - if [[ ${{ inputs.eventname }} == 'pull_request' ]]; then - echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV - else - echo "PLATFORMS=${{ inputs.platforms }}" >> $GITHUB_ENV - fi + echo "PLATFORMS=${{ inputs.platforms }}" >> $GITHUB_ENV - name: Checkout repository uses: actions/checkout@v4 - name: Set up QEMU diff --git a/Docker/PlexAniSync/Dockerfile b/Docker/PlexAniSync/Dockerfile index 1654e32..c1b177f 100644 --- a/Docker/PlexAniSync/Dockerfile +++ b/Docker/PlexAniSync/Dockerfile @@ -1,8 +1,9 @@ -FROM python:3.11 AS builder +FROM python:3.12 AS builder RUN apt-get update && \ apt-get install -y \ build-essential \ + rustc \ && apt-get clean && rm -rf /var/lib/apt/lists/* RUN pip install --upgrade pip @@ -11,7 +12,7 @@ COPY requirements.txt . # install dependencies to the local user directory (eg. /root/.local) RUN pip install --user --no-warn-script-location -r requirements.txt -FROM python:3.11-slim +FROM python:3.12-slim WORKDIR /plexanisync From 40275c27b3ed02455a2c4f89946f0438dc3b3524 Mon Sep 17 00:00:00 2001 From: reconman Date: Sun, 12 May 2024 14:05:41 +0200 Subject: [PATCH 2/5] Set cargo to sparse --- Docker/PlexAniSync/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Docker/PlexAniSync/Dockerfile b/Docker/PlexAniSync/Dockerfile index c1b177f..b31e734 100644 --- a/Docker/PlexAniSync/Dockerfile +++ b/Docker/PlexAniSync/Dockerfile @@ -1,9 +1,12 @@ FROM python:3.12 AS builder +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + RUN apt-get update && \ apt-get install -y \ build-essential \ rustc \ + git \ && apt-get clean && rm -rf /var/lib/apt/lists/* RUN pip install --upgrade pip From d7ea1255666e07e4c7e1266fc554df1360b8627b Mon Sep 17 00:00:00 2001 From: reconman Date: Sun, 12 May 2024 14:20:06 +0200 Subject: [PATCH 3/5] Only build on arm/v6 for now --- .github/workflows/build-docker-image.yml | 6 +++++- Docker/PlexAniSync/Dockerfile | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 7c4cacf..ed62227 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -40,7 +40,11 @@ jobs: echo "DOCKER_IO=true" >> $GITHUB_ENV fi - echo "PLATFORMS=${{ inputs.platforms }}" >> $GITHUB_ENV + if [[ ${{ inputs.eventname }} == 'pull_request' ]]; then + echo "PLATFORMS=linux/arm/v6" >> $GITHUB_ENV + else + echo "PLATFORMS=${{ inputs.platforms }}" >> $GITHUB_ENV + fi - name: Checkout repository uses: actions/checkout@v4 - name: Set up QEMU diff --git a/Docker/PlexAniSync/Dockerfile b/Docker/PlexAniSync/Dockerfile index b31e734..957f251 100644 --- a/Docker/PlexAniSync/Dockerfile +++ b/Docker/PlexAniSync/Dockerfile @@ -13,7 +13,10 @@ RUN pip install --upgrade pip COPY Docker/PlexAniSync/pip.conf /etc/pip.conf COPY requirements.txt . # install dependencies to the local user directory (eg. /root/.local) -RUN pip install --user --no-warn-script-location -r requirements.txt +RUN --mount=type=tmpfs,target=/root/.cargo \ + CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \ + CARGO_HOME=/root/.cargo \ + pip install --user --no-warn-script-location -r requirements.txt FROM python:3.12-slim From 460ca96dc8e3a15d0c5188fbd31c3faf0cfb0bc5 Mon Sep 17 00:00:00 2001 From: reconman Date: Mon, 3 Jun 2024 02:19:55 +0200 Subject: [PATCH 4/5] Install testing variant of rustc --- Docker/PlexAniSync/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docker/PlexAniSync/Dockerfile b/Docker/PlexAniSync/Dockerfile index 957f251..a2ba440 100644 --- a/Docker/PlexAniSync/Dockerfile +++ b/Docker/PlexAniSync/Dockerfile @@ -5,7 +5,7 @@ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse RUN apt-get update && \ apt-get install -y \ build-essential \ - rustc \ + rustc/testing \ git \ && apt-get clean && rm -rf /var/lib/apt/lists/* From a755ceb37810057ff7c15658a4721e38353ec1de Mon Sep 17 00:00:00 2001 From: reconman Date: Mon, 3 Jun 2024 22:17:41 +0200 Subject: [PATCH 5/5] Test ubuntu based image --- Docker/PlexAniSync/Dockerfile | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Docker/PlexAniSync/Dockerfile b/Docker/PlexAniSync/Dockerfile index a2ba440..69abe03 100644 --- a/Docker/PlexAniSync/Dockerfile +++ b/Docker/PlexAniSync/Dockerfile @@ -1,11 +1,24 @@ -FROM python:3.12 AS builder +ARG python_version=3.12 + +FROM ubuntu AS base +ARG python_version + +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt-get update && \ + apt-get install -y python-${python_version} python3-pip && \ + apt-get clean && rm -rf /var/lib/apt/lists/* && \ + python3 -m pip install pip && \ + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \ + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + +FROM base AS builder ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse RUN apt-get update && \ apt-get install -y \ build-essential \ - rustc/testing \ + rustc \ git \ && apt-get clean && rm -rf /var/lib/apt/lists/* @@ -18,7 +31,8 @@ RUN --mount=type=tmpfs,target=/root/.cargo \ CARGO_HOME=/root/.cargo \ pip install --user --no-warn-script-location -r requirements.txt -FROM python:3.12-slim +FROM base +ARG python_version WORKDIR /plexanisync @@ -27,7 +41,7 @@ COPY --from=builder /root/.local /root/.local RUN chmod -R a+rX /root # update PATH environment variable ENV PATH=/root/.local:$PATH -ENV PYTHONPATH=/root/.local/lib/python3.11/site-packages +ENV PYTHONPATH=/root/.local/lib/python${python_version}/site-packages ENV PLEX_SECTION=Anime \ PLEX_URL=http://127.0.0.1:32400 \