Reference

Command Reference

We included a few commands in the /usr/local/bin directory to help you with your development experience. These commands are available in the serversideup/php image.

Since our images are unprivileged by default, you'll need to switch to the root user to run these commands. This is a security feature that ensures that your container is as secure as possible.

Official PHP Docker Commands

Since our images are based off the official PHP Docker images, any commands from the Official PHP Docker images are available in our images. You can find the full list of commands on the official PHP Docker images documentation.

docker-php-serversideup-dep-install-alpine

This command will detect the operating system and install packages if it is an Alpine based system. This is helpful if you're building multiple operating systems from the same Dockerfile.

Example - Installing the git package on Alpine
# Usage: docker-php-serversideup-dep-install-alpine [alpine-packages]
docker-php-serversideup-dep-install-alpine git

Packages can be passed as separate arguments, as a comma-separated list, or split across multiple lines with backslash continuations:

Example - Installing multiple packages on Alpine
# Separate arguments
docker-php-serversideup-dep-install-alpine git zip unzip

# Comma-separated
docker-php-serversideup-dep-install-alpine "git, zip, unzip"

# Backslash continuations (useful in a Dockerfile)
docker-php-serversideup-dep-install-alpine \
    git \
    zip \
    unzip

docker-php-serversideup-dep-install-debian

This command will detect the operating system and install packages if it is a Debian based system. This is helpful if you're building multiple operating systems from the same Dockerfile.

Example - Installing the git package on Debian
# Usage: docker-php-serversideup-dep-install-debian [debian-packages]
docker-php-serversideup-dep-install-debian git

Packages can be passed as separate arguments, as a comma-separated list, or split across multiple lines with backslash continuations:

Example - Installing multiple packages on Debian
# Separate arguments
docker-php-serversideup-dep-install-debian git zip unzip

# Comma-separated
docker-php-serversideup-dep-install-debian "git, zip, unzip"

# Backslash continuations (useful in a Dockerfile)
docker-php-serversideup-dep-install-debian \
    git \
    zip \
    unzip

docker-php-serversideup-download

A build-time helper that downloads a file with retries. Our build matrix starts every image at the same moment, and hosts like GitHub occasionally answer that burst with a 500. This command retries five times with a short backoff and fails the build if the file never arrives. It's useful in your own Dockerfiles for the same reason.

Example - Downloading a file during a build
# Usage: docker-php-serversideup-download <url> [output-file]
docker-php-serversideup-download https://example.com/tool.tar.gz /tmp/tool.tar.gz

# Without an output file, the download is written to stdout
docker-php-serversideup-download https://example.com/key.asc | gpg --dearmor > /usr/share/keyrings/example.gpg

docker-php-serversideup-entrypoint

Our default entrypoint script that is used for all images.

docker-php-serversideup-install-php-extensions

This command installs PHP extensions with install-php-extensions. It optionally accepts a second argument of space separated name=source pairs, which swap an extension for a different source. This is useful when an extension needs to be built from a branch or tag instead of the latest PECL release.

Example - Installing extensions with an override
# Usage: docker-php-serversideup-install-php-extensions [extensions] [overrides]
docker-php-serversideup-install-php-extensions "opcache redis zip" "redis=phpredis/phpredis@develop"

The example above installs opcache and zip normally, but builds redis from the develop branch of phpredis/phpredis.

docker-php-serversideup-install-php-ext-installer

This is an internal helper script to shorten up the syntax for the installation of the PHP extension installer.

Example - Installing the PHP extension installer
# Usage: docker-php-serversideup-install-php-ext-installer [version]
docker-php-serversideup-install-php-ext-installer 2.2.0

docker-php-serversideup-set-file-permissions

This command is used to set the file permissions of a service in the container. This is useful for development environments where you want to match the user and group ID of the host machine.

Learn more about working with file permissions →

Example - Setting the file permissions of the NGINX service
# Usage: docker-php-serversideup-set-file-permissions --owner USER:GROUP
docker-php-serversideup-set-file-permissions --owner 1000:1000

The above command will automatically detect the service and update the file permissions accordingly.

docker-php-serversideup-set-id

This command is used to set the user and group ID of the www-data user in the container. This is useful for development environments where you want to match the user and group ID of the host machine.

Learn more about working with file permissions →

Example - Setting the user and group ID of the www-data user
#  docker-php-serversideup-set-id [username] [uid]:[gid]
docker-php-serversideup-set-id www-data 1000:1000

docker-php-serversideup-s6-init

This command converts every script in /etc/entrypoint.d into an S6 Overlay oneshot service that runs in the same order the entrypoint would have run it. This is useful when your own S6 service needs to wait for one of our scripts. It is safe to run more than once, so a base image and an image built on it can both use it.

Learn more about using S6 Overlay dependencies →

docker-php-serversideup-s6-install

This is a command used at build time to install a specific version of S6 Overlay.

healthcheck-octane

Runs php artisan octane:status so a container health check can confirm that the Octane server is running. It ships in every image and works with any Octane server (FrankenPHP, Swoole, Open Swoole, or RoadRunner), but only in a container where Octane started the server.

Learn more about Laravel Octane →

install-php-extensions

This command is a wrapper around the docker-php-ext-install command that comes with the official PHP Docker images. This command allows you to install PHP extensions with a single command.

Check out the docker-php-extension-installer project on GitHub →

Here's an example of how you can use this command:

Example - Installing the "intl" extension
install-php-extensions intl