diff --git a/public/img/blog/2025/06/ddev-tool-install.png b/public/img/blog/2025/06/ddev-tool-install.png new file mode 100644 index 00000000..506e50ba Binary files /dev/null and b/public/img/blog/2025/06/ddev-tool-install.png differ diff --git a/src/content/authors/bill-seremetis.md b/src/content/authors/bill-seremetis.md new file mode 100644 index 00000000..062ffca3 --- /dev/null +++ b/src/content/authors/bill-seremetis.md @@ -0,0 +1,14 @@ +--- +name: Bill Seremetis +firstName: Bill +avatarUrl: http://seremetis.net/static/bill.jpg +--- + +[Bill](https://www.drupal.org/u/bserem) is the Managed Services team’s Tech Lead +in [Annertech](https://www.annertech.com), a long time Drupal developer and +DDEV user. +His career started as a site builder, but quickly turned into systems administrator +and backend developer. He loves steering conversations towards workable solutions +and improving developer's lives. + +When not behind a screen you'll find him holding a camera and climbing easy routes. diff --git a/src/content/blog/ddev-bundled-tools-using-custom-versions.md b/src/content/blog/ddev-bundled-tools-using-custom-versions.md new file mode 100644 index 00000000..777bd211 --- /dev/null +++ b/src/content/blog/ddev-bundled-tools-using-custom-versions.md @@ -0,0 +1,73 @@ +--- +title: "How to Downgrade Terminus in DDEV's Web Container and Customize Other Bundled Tools" +pubDate: 2025-06-30 +summary: How to upgrade/downgrade a utility provided by DDEV in `ddev-webserver`, or add a custom utility for a given project +author: Bill Seremetis +featureImage: + src: /img/blog/2025/06/ddev-tool-install.png + alt: "Installing custom software packages in the containerized environment" + shadow: true +categories: + - Guides + - DevOps +--- + +_This guest post is by DDEV community member and [Drupal](https://drupal.org) +contributor [Bill Seremetis](/blog/author/bill-seremetis/) and sponsored by +[Annertech](https://www.annertech.com)._ + +DDEV comes bundled with a predefined set of tools, Pantheon's `terminus` being one of them. +The latest releases of `terminus` are not compatible with older PHP versions like PHP 8.1, though, +so we needed to downgrade it inside DDEV's `ddev-webserver` Docker image. + +This guide covers how to downgrade `terminus` and will also explain how to use the same technique to install +additional custom tools. + +Please note there are many ways to install packages in a container. We will +cover [extra Dockerfiles](https://ddev.readthedocs.io/en/stable/users/extend/customizing-images/#adding-extra-dockerfiles-for-webimage-and-dbimage) +here, but also [check `webimage_extra_packages` and `dbimage_extra_packages` in your +`config.yaml`for more details](https://ddev.readthedocs.io/en/stable/users/extend/customizing-images/#adding-extra-debian-packages-with-webimage_extra_packages-and-dbimage_extra_packages)). + +## Case study: Manually Downgrading Terminus + +[Terminus](https://github.com/pantheon-systems/terminus/releases) dropped +support for PHP 8.1 in recent versions, but some of our +projects still use PHP 8.1. We had to downgrade the DDEV-bundled version of `terminus` for those +projects by using a custom Dockerfile: + +```dockerfile +# .ddev/web-build/Dockerfile.terminus +# Terminus 4 drops support for PHP 8.1 which we still need +ARG TERMINUS_VERSION="3.6.2" +RUN curl -L --fail -o /usr/local/bin/terminus https://github.com/pantheon-systems/terminus/releases/download/${TERMINUS_VERSION}/terminus.phar && chmod +x /usr/local/bin/terminus +``` + +`terminus` is just an example here, it could be any command you wish, +[either because you are running an older PHP version](https://github.com/pantheon-systems/terminus/releases/tag/4.0.0) +or the bundled version [has a bug that ruins things for you](https://github.com/platformsh/cli/discussions/166). + +## Installing custom tools + +You can obviously use the same techniques to install a variety of custom tools: + +```dockerfile +# .ddev/web-build/Dockerfile.fzf +# fooscript relies on fzf +# fooscript lists all your Pantheon projects using a fuzzy finder list +ARG FZF_VERSION="0.62.0" +RUN curl -s -L https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-linux_amd64.tar.gz | tar xvz -C /usr/local/bin/ && chmod +x /usr/local/bin/fzf +``` + +## Resources + +- [DDEV Pantheon integration documentation](https://ddev.readthedocs.io/en/stable/users/providers/pantheon/) +- [Adding extra Dockerfiles for `webimage` and `dbimage`](https://ddev.readthedocs.io/en/stable/users/extend/customizing-images/#adding-extra-dockerfiles-for-webimage-and-dbimage) +- [Adding extra Debian packages in DDEV](https://ddev.readthedocs.io/en/stable/users/extend/customizing-images/#adding-extra-debian-packages-with-webimage_extra_packages-and-dbimage_extra_packages) +- [Customizing DDEV images with a custom Dockerfile](https://ddev.com/blog/customizing-ddev-local-images-with-a-custom-dockerfile/) + +## Contribute to DDEV + +If you like DDEV then you are welcome to contribute! You can join the [Discord channel](/s/discord), +create a new [DDEV Add-on](https://ddev.readthedocs.io/en/stable/users/extend/additional-services/), +or blog about how you use DDEV in your daily workflow. +We’re always happy to hear from you on any of our [support channels](https://ddev.readthedocs.io/en/stable/users/support/).