Docker container with Apache PHP 7.4 build by Nix package manager.
Before you begin, ensure you have met the following requirements:
- You have a
<Linux/Mac>
machine. - You have installed the latest version of Nix package manager and Docker daemon.
To build Apache PHP 7.4, follow these steps:
Linux and macOS:
docker load --input $(nix-build --argstr overlayUrl https://github.com/mjuh/ci-nixpkgs.git --no-out-link)
Hint: If you failed to build with your current nixpkgs version, try to build with a tested nixpkgs version.
To use Apache PHP 7.4, call:
docker inspect docker-registry.intr/webservices/apache2-php74 | grep cmd
which will produce flags for docker run
command as a hint.
For example:
docker run --read-only --network=host \
--mount readonly,source=/etc/ssl,target=/etc/ssl,type=bind \
--mount readonly,source=$SITES_CONF_PATH,target=/read/sites-enabled,type=bind \
--mount readonly,source=/opt/etc,target=/opt/etc,type=bind \
--mount source=/opt/postfix/spool/maildrop,target=/var/spool/postfix/maildrop,type=bind \
--mount source=/opt/postfix/spool/public,target=/var/spool/postfix/public,type=bind \
--mount source=/opt/postfix/lib,target=/var/lib/postfix,type=bind \
--mount source=/opcache,target=/opcache,type=bind \
--mount target=/run,type=tmpfs \
--mount source=/home,target=/home,type=bind \
--tmpfs /tmp:mode=1777 \
--tmpfs /run/bin:exec,suid \
-e HTTPD_PORT=$SOCKET_HTTP_PORT \
-e PHP_INI_SCAN_DIR=:/etc/phpsec/$SECURITY_LEVEL \
-e PHP_SECURITY=/etc/phpsec/$SECURITY_LEVEL \
--ulimit stack=-1:-1 \
--cap-add SYS_ADMIN \
--security-opt apparmor:unconfined docker-registry.intr/webservices/apache2-php74:latest
before running the command you need to provide all variables:
$SITES_CONF_PATH
should point to a directory with Apache's configuration files for vhosts.$SECURITY_LEVEL
should be one of:default
,unsafe
,hardened
,hardened-nochmod
.$SOCKET_HTTP_PORT
any free port on your computer, e.g.8074
.
To contribute to Apache PHP 7.4, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
If you want to contact me you can reach us at support@majordomo.ru.
This project uses the following license: Apache-2.0.