Build your own image
Abuser Documentation
Build your own image
Software Requirements
You must have the following tools installed locally:
- Python3
PyYAMLPython package (either via pip or OS packet manager)makedocker
Other Requirements
You should have a brief understanding about the different flavours available in this repository.
ℹ️ For details see README.md#flavours
ℹ️ For details see Documentation: Flavours
How does it work?
This repository already has all the automation in place.
- For each PHP version a
baseimage is built to streamline settings across all PHP versions. - Based on the
baseimage, amodsimage is built, which only adds a whole bunch of PHP extensions. - Based on the
modsimage, aprodimage is built, which adds features to alter the startup behaviour. - Based on the
prodimage, aworkimage is built, which acts as an integrated development environment in which you can actually work (adds a whole bunch of tools).
What you need to do, is to:
- Ensure the
baseimage is available locally on your system (either by building it or by pulling it). - Decide on the PHP extensions that you want to add
- Decide on the PHP version you want to build
- Decide on the architecture/platform you want to build the Docker image for (
amd64orarm64). - Build the
modsimage (or just create the Dockerfile for it).
With this you will be all set, you can however decide to build the prod flavour on top of your custom mods image as it adds a lot of configurable environment variables to dynamically alter the startup behaviour.
In case you plan to use your custom image for the Devilbox, you must also go ahead and built the work flavour on top of the prod flavour.
Generate your custom Dockerfile
Note: All commands are executed in the root of this repository
- Generate PHP extensions in Ansible group_vars
# Generate Ansible group_vars for all available extensions make gen-modules# Generate Ansible group_vars for selected extensions # Note: that also all dependent extensions will be added make gen-modules ARGS="msgpack xsl"# Generate Ansible group_vars for selected extensions # and ignore dependencies make gen-modules ARGS="-i msgpack xsl"# Show help make gen-modules ARGS="--help" - Generate Dockerfiles from Ansible group_vars
make gen-dockerfiles
Build your custom Dockerfile
Note: All commands are executed in the root of this repository
- Ensure you have the
baseimage locally for your desired version and architectureARCH=linux/amd64 VERSION=8.1 make docker-pull-base-image STAGE=mods VERSION=${VERSION} ARCH=${ARCH} - Build the
modsimageARCH=linux/amd64 VERSION=8.1 make build STAGE=mods VERSION=${VERSION} ARCH=${ARCH} - (Optional) Build the
prodimageARCH=linux/amd64 VERSION=8.1 make build STAGE=prod VERSION=${VERSION} ARCH=${ARCH} - (Optional) Build the
workimageARCH=linux/amd64 VERSION=8.1 make build STAGE=work VERSION=${VERSION} ARCH=${ARCH}
FAQ
- Where do I find the generated Dockerfile?
- How can I omit dependent PHP extensions when generating the Dockerfile?
- How do I ensure that dependent PHP extensions are automatically added to the Dockerfile?
- Where do I see what PHP extensions are available in this repository?
- How do I know what each of the provided PHP extensions is for?
- How can I add PHP extensions that are not provided here?
- Switching architectures fails with errors, what should I do?