diff --git a/Makefile b/Makefile index 2caabd8a0..ffbd81dce 100644 --- a/Makefile +++ b/Makefile @@ -193,6 +193,7 @@ versioned-images := php-8.1-fpm \ python-3.10 \ python-3.11 \ python-3.12 \ + python-3.13 \ node-18 \ node-18-builder \ node-18-cli \ @@ -292,7 +293,7 @@ build/php-8.3-cli: build/php-8.3-fpm build/php-8.1-cli-drupal: build/php-8.1-cli build/php-8.2-cli-drupal: build/php-8.2-cli build/php-8.3-cli-drupal: build/php-8.3-cli -build/python-3.7 build/python-3.8 build/python-3.9 build/python-3.10 build/python-3.11 build/python-3.12: build/commons +build/python-3.7 build/python-3.8 build/python-3.9 build/python-3.10 build/python-3.11 build/python-3.12 build/python-3.13: build/commons build/node-18 build/node-20 build/node-22: build/commons build/node-18-builder build/node-18-cli: build/node-18 build/node-20-builder build/node-20-cli: build/node-20 diff --git a/helpers/TESTING_base_images_dockercompose.md b/helpers/TESTING_base_images_dockercompose.md index 1cee12b3b..034adb45f 100644 --- a/helpers/TESTING_base_images_dockercompose.md +++ b/helpers/TESTING_base_images_dockercompose.md @@ -49,6 +49,7 @@ docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep python-3-10 docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep python-3-11 docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep python-3-12 +docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep python-3-13 docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep ruby-3-1 docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep ruby-3-2 docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep ruby-3-3 @@ -236,6 +237,16 @@ docker compose exec -T python-3-12 sh -c "pip list --no-cache-dir" | grep "virtu # python-3-12 should be serving content docker compose exec -T commons sh -c "curl python-3-12:3000/tmp/test" | grep "Python 3.12" +# python-3-13 should be version 3.13 +docker compose exec -T python-3-13 sh -c "python -V" | grep "3.13" + +# python-3-13 should have basic tools installed +docker compose exec -T python-3-13 sh -c "pip list --no-cache-dir" | grep "pip" +docker compose exec -T python-3-13 sh -c "pip list --no-cache-dir" | grep "virtualenv" + +# python-3-13 should be serving content +docker compose exec -T commons sh -c "curl python-3-13:3000/tmp/test" | grep "Python 3.13" + # node-18 should have Node 18 docker compose exec -T node-18 sh -c "node -v" | grep "v18" diff --git a/helpers/images-docker-compose.yml b/helpers/images-docker-compose.yml index 9b9189257..ab116f90a 100644 --- a/helpers/images-docker-compose.yml +++ b/helpers/images-docker-compose.yml @@ -190,6 +190,16 @@ services: exec python -m http.server 3000 "] + python-3-13: + image: uselagoon/python-3.13:latest + ports: + - "3000" + << : *default-user # uses the defined user from top + command: ["sh", "-c", " + python -V | xargs > tmp/test; + exec python -m http.server 3000 + "] + ruby-3-1: image: uselagoon/ruby-3.1:latest ports: diff --git a/images/python/3.13.Dockerfile b/images/python/3.13.Dockerfile new file mode 100644 index 000000000..2f085f2c4 --- /dev/null +++ b/images/python/3.13.Dockerfile @@ -0,0 +1,52 @@ +ARG IMAGE_REPO +FROM ${IMAGE_REPO:-lagoon}/commons AS commons + +FROM python:3.13.0-alpine3.20 + +ARG LAGOON_VERSION +ENV LAGOON_VERSION=$LAGOON_VERSION +LABEL org.opencontainers.image.authors="The Lagoon Authors" +LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images/blob/main/images/python/3.13.Dockerfile" +LABEL org.opencontainers.image.url="https://github.com/uselagoon/lagoon-images" +LABEL org.opencontainers.image.version="${LAGOON_VERSION}" +LABEL org.opencontainers.image.description="Python 3.13 image optimised for running in Lagoon in production and locally" +LABEL org.opencontainers.image.title="uselagoon/python-3.13" +LABEL org.opencontainers.image.base.name="docker.io/python:3.13-alpine3.20" + +ENV LAGOON=python + +# Copy commons files +COPY --from=commons /lagoon /lagoon +COPY --from=commons /bin/fix-permissions /bin/ep /bin/docker-sleep /bin/wait-for /bin/ +COPY --from=commons /sbin/tini /sbin/ +COPY --from=commons /home /home + +RUN fix-permissions /etc/passwd \ + && mkdir -p /home + +ENV TMPDIR=/tmp \ + TMP=/tmp \ + HOME=/home \ + # When Bash is invoked via `sh` it behaves like the old Bourne Shell and sources a file that is given in `ENV` + ENV=/home/.bashrc \ + # When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV` + BASH_ENV=/home/.bashrc + +RUN apk update \ + && apk add --no-cache --virtual .build-deps \ + build-base \ + && pip install --upgrade pip \ + && pip install virtualenv \ + && apk del \ + .build-deps \ + && apk add --no-cache \ + rsync \ + tar \ + && rm -rf /var/cache/apk/* + +# Make sure shells are not running forever +COPY 80-shell-timeout.sh /lagoon/entrypoints/ +RUN echo "source /lagoon/entrypoints/80-shell-timeout.sh" >> /home/.bashrc + +ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.sh"] +CMD ["python"]