From 969a9e2162d96eda852e47aac59184dc36f928cf Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 28 Apr 2025 13:12:28 +0545 Subject: [PATCH] chore: switch to Freexian PHP 7.4 on Ubuntu 20.04 --- .drone.star | 22 ++++++++++++++++++++++ v20.04/Dockerfile.multiarch | 16 ++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/.drone.star b/.drone.star index 3b64357..10eb471 100644 --- a/.drone.star +++ b/.drone.star @@ -170,6 +170,7 @@ def prepublish(config): "from_secret": "internal_password", }, "tags": config["internal"], + "build_args_from_env": ["DEB_MIRROR_URL", "DEB_MIRROR_LOGIN", "DEB_MIRROR_PWD"], "dockerfile": "%s/Dockerfile.multiarch" % (config["version"]["path"]), "repo": "registry.drone.owncloud.com/owncloud/%s" % config["repo"], "registry": "registry.drone.owncloud.com", @@ -178,6 +179,15 @@ def prepublish(config): }, "environment": { "BUILDKIT_NO_CLIENT_TOKEN": True, + "DEB_MIRROR_URL": { + "from_secret": "DEB_MIRROR_URL", + }, + "DEB_MIRROR_LOGIN": { + "from_secret": "DEB_MIRROR_LOGIN", + }, + "DEB_MIRROR_PWD": { + "from_secret": "DEB_MIRROR_PWD", + }, }, }, ] @@ -254,11 +264,23 @@ def publish(config): "linux/arm64", ], "tags": config["version"]["tags"], + "build_args_from_env": ["DEB_MIRROR_URL", "DEB_MIRROR_LOGIN", "DEB_MIRROR_PWD"], "dockerfile": "%s/Dockerfile.multiarch" % (config["version"]["path"]), "repo": "owncloud/%s" % config["repo"], "context": config["version"]["path"], "pull_image": False, }, + "environment": { + "DEB_MIRROR_URL": { + "from_secret": "DEB_MIRROR_URL", + }, + "DEB_MIRROR_LOGIN": { + "from_secret": "DEB_MIRROR_LOGIN", + }, + "DEB_MIRROR_PWD": { + "from_secret": "DEB_MIRROR_PWD", + }, + }, "when": { "ref": [ "refs/heads/master", diff --git a/v20.04/Dockerfile.multiarch b/v20.04/Dockerfile.multiarch index 37b2224..6dda157 100644 --- a/v20.04/Dockerfile.multiarch +++ b/v20.04/Dockerfile.multiarch @@ -7,11 +7,24 @@ LABEL maintainer="ownCloud GmbH " \ org.opencontainers.image.source="https://github.com/owncloud-docker/php" \ org.opencontainers.image.documentation="https://github.com/owncloud-docker/php" +ARG DEB_MIRROR_URL +ARG DEB_MIRROR_LOGIN +ARG DEB_MIRROR_PWD + EXPOSE 8080 ENTRYPOINT ["/usr/bin/entrypoint"] CMD ["/usr/bin/server"] +# Get the key that the Freexian deb mirror uses for signing +RUN wget http://php.freexian.com/public/archive-key.gpg -O /etc/apt/trusted.gpg.d/freexian-archive-php.gpg +# Get the authentication details for the deb mirror that has been set up to serve the Freexian PHP packages +RUN echo "machine $DEB_MIRROR_URL login $DEB_MIRROR_LOGIN password $DEB_MIRROR_PWD" > /etc/apt/auth.conf.d/freexian.conf + +RUN apt-get update -y && \ + apt-get install -y software-properties-common language-pack-en-base && \ + apt-add-repository "https://$DEB_MIRROR_URL/php.freexian.com/ bookworm main" + RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ apache2 \ @@ -65,5 +78,8 @@ RUN apt-get update -y && \ rm -rf /var/lib/apt/lists/* /usr/local/share/doc/* /usr/local/include/* /tmp/* && \ apt-get clean +# delete the file that has the authentication for the Freexian deb package server, so that it can't end up in the built docker image +RUN rm -f /etc/apt/auth.conf.d/freexian.conf + ADD overlay / WORKDIR /var/www/html