Innovate faster and cut risk with PHP experts from Zend Services.
See How Zend Helps Leading Hosting Providers Keep Their Managed Sites on Secure PHP
Learn PHP from PHP experts with free, on-demand, and instructor led courses.
Submit support requests and browse self-service resources.
Matthew Weier O’Phinney
The 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 ZendPHP for 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."
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 Registry
Zend 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 Registry
We 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:
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.
We 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.
We provide images on cr.zend.com using the following name template:
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!
Using 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 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 Details
Ready to see how ZendPHP works in your environment? Try ZendPHP free for 30 days via the link below.
See Trial Details
Zend Product Manager, 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.