BreadcrumbHomeResourcesBlog Introducing Zend Alpine Linux PHP Images April 6, 2023 Introducing Zend Alpine Linux PHP ImagesPHP DevelopmentBy Matthew Weier O’PhinneyThe Zend by Perforce team is thrilled to announce the immediate availability of Zend Alpine Linux PHP images. The images, which are built using Alpine Linux 3.16, make it easy for teams using end of life PHP to take advantage of the security and performance benefits of Alpine Linux.In this blog, I'll walk through a bit of background on Alpine Linux, why it's a popular distro for PHP teams, and how to get started with Zend Alpine Linux PHP images.Table of ContentsWhat Is Alpine Linux?Download PHP Alpine Linux ImagesZendPHP for Alpine LinuxInstalling ZendPHP in Alpine LinuxZend Alpine Linux PHP Images for DockerFinal ThoughtsTable of Contents1 - What Is Alpine Linux?2 - Download PHP Alpine Linux Images3 - ZendPHP for Alpine Linux4 - Installing ZendPHP in Alpine Linux5 - Zend Alpine Linux PHP Images for Docker6 - Final ThoughtsBack to topWhat Is Alpine Linux?Alpine Linux is a minimal-profile, security-focused Linux distribution commonly used in containerized environments.Alpine Linux is an open source project with origins as a fork of the LEAF Project, which itself was a fork from the Linux Router Project (which hoped to create a Linux distro that could fit on a single floppy disk). In the time since inception, Alpine Linux has stayed true to its origins — operating under the motto of "small, simple, and secure."Why Are Alpine Linux PHP Images Popular?Common tenets of building application containers are to keep the size of the image minimal, and to only install what is absolutely needed. These practices help reduce security risk, reduce storage size in you registries, and improve startup times (smaller images size take less time to pull, and generally less time to bootstrap).The most minimal image in the container ecosystem is scratch. However, it requires you install absolutely everything you need in order to run and monitor a service, which can lead to a lot of extra work and maintenance.Alpine Linux is a good middle ground. Built on top of busybox, it has a minimal configuration that largely meets the needs of security and performance concerns, and provides both a minimal package manager and library of packages that prevents you from needing to compile and install everything needed for your application or service.Because of its performance and security benefits (which are two top concerns for PHP teams), Alpine Linux is a popular choice for PHP applications — especially container-based PHP applications.Back to topDownload PHP Alpine Linux ImagesZend Alpine Linux PHP images are available for download from our container registry. Access today, and explore our other container OS options, via the link below.Visit the Container RegistryBack to topZendPHP for Alpine LinuxWe have provided ZendPHP to Alpine Linux 3.16 via a custom Alpine Linux package repository, and compiled our packages to mimic the official PHP packages provided by Alpine. We provide packages for both x86_64 and arm64 architectures.Key differences from the standard Alpine Linux PHP packages include:You can install multiple PHP versions in parallel.We provide LTS editions of PHP.We provide and maintain more extensions than the official Alpine Linux packages.We provide ZendHQ in addition to ZendPHP.While you can use Alpine as a minimal Linux distribution, the typical use case will be within containers. We provide ready-built ZendPHP containers for Alpine Linux 3.16, for each PHP version we support, and with CLI, php-fpm, and Apache versions for each. Like all ZendPHP images, you can use our build-argument customizable Dockerfile in order to streamline customization of your ZendPHP images.Included in our ZendPHP repository for Alpine Linux is ZendHQ. All features present on other distributions are present in the Alpine Linux distribution as well.Back to topInstalling ZendPHP in Alpine LinuxWe recommend using the zendphpctl script for installing and managing ZendPHP on Alpine. The primary reason is that when using this script, automation you build will not need to change when you change operating systems or operating system versions. Additionally, we provide mechanisms in zendphpctl for handling authentication and authorization to the ZendPHP package repository that you would otherwise need to handle manually.The typical workflow is: zendphpctl repo install zendphpctl php install 8.1 zendphpctl fpm install zendphpctl ext install ... We provide instructions for manually installing ZendPHP on Alpine. These detail how to add the repository, steps needed for authentication/authorization with the repository, and how to install packages. We also detail how to compile non-standard or custom PHP extensions for the distribution.Back to topZend Alpine Linux PHP Images for DockerWe provide Alpine Linux PHP images on cr.zend.com using the following name template: cr.zend.com/zendphp/{PHP_VERSION}:alpine-3.16-(cli|fpm|apache)(-arm64)Like all our other images, they include s6-overlay, providing the ability to run services securely as non-root users, and to run multiple services in the same container. All images can be managed via the custom Dockerfile if desired. These image sizes are as much as 90% smaller than images for other operating systems we provide!Back to topFinal ThoughtsUsing ZendPHP with Alpine Linux gives PHP teams the full security and performance benefits of Alpine Linux as well as ability to work with fully-patched and supported EOL PHP versions. Add to that a broader selection of extensions, and you also get the benefit of added extensibility for your deployments.If your team is deploying (or considering deploying) PHP with Alpine Linux, I highly encourage you to take our new Alpine Linux PHP images for a test drive. As mentioned earlier, these images can be as little as 10% of the size of our standard Linux images — which can mean big cost savings wherever you may deploy.Try ZendPHP for FreeReady to see how ZendPHP works in your environment? Try ZendPHP free for 30 days via the link below. See Trial DetailsAdditional ResourcesResource - Zend Container RegistryBlog - The Importance of Easy to Use PHP Linux ImagesBlog - Introducing the New Zend Puppet PHP ModulesBlog - Using Containers to Improve PHP Application SecurityBlog - PHP Cloud Hosting, Containerization, and Orchestration TrendsBlog - The Impact of PHP ARM Architecture SupportOn-Demand Webinar - PHP Observability and Orchestration With ZendHQ Back to top
Matthew Weier O’Phinney Senior Product Manager, OpenLogic and Zend by Perforce Matthew began developing on Zend Framework (ZF) before its first public release, and led the project for Zend from 2009 through 2019. He is a founding member of the PHP Framework Interop Group (PHP-FIG), which creates and promotes standards for the PHP ecosystem — and is serving his second elected term on the PHP-FIG Core Committee.