Skip to content

Commit

Permalink
[5.x] Some minor fixes (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinsenter authored Aug 1, 2024
1 parent 50b933a commit 39d7807
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/php/common/os-s6-overlay.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if [ -n "$S6_VERSION" ]; then
# inject legacy entrypoint
if [ -x $FALLBACK_ENTRYPOINT ]; then
env-default FALLBACK_ENTRYPOINT $FALLBACK_ENTRYPOINT
sed -i "s|^exec |\nif [ \$# -eq 0 ]; then set -- $FALLBACK_ENTRYPOINT \"\$@\"; fi\n\nexec |" /init
sed -i "s|^exec |\n# CAUTION: this may crash s6-overlay\n# if [ \$# -eq 0 ]; then set -- $FALLBACK_ENTRYPOINT \"\$@\"; fi\n\nexec |" /init
fi

# add setuid bit
Expand Down
6 changes: 6 additions & 0 deletions src/php/with-apache/apache-config.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ a2enmod \
cache cgid deflate dir env expires filter headers http2 log_config mime mime_magic \
mpm_event negotiation proxy proxy_fcgi remoteip rewrite setenvif ssl status unixd 2>&1 || true

# fix ProxyFCGIBackendType directive for Apache 2.4
if apache-test 'ProxyFCGIBackendType'; then
echo 'Disable ProxyFCGIBackendType because it is not supported in this Apache version'
sed -i 's/ProxyFCGIBackendType/#ProxyFCGIBackendType/g' $CONF_FILE
fi

# create s6 services
if has-cmd s6-service; then
s6-service php-fpm longrun '#!/usr/bin/env sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Listen 80
SSLEngine On
SSLCertificateFile /etc/ssl/site/server.crt
SSLCertificateKeyFile /etc/ssl/site/server.key
SSLProtocol TLSv1.2 TLSv1.3
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
</VirtualHost>
</IfModule>
2 changes: 2 additions & 0 deletions src/php/with-apache/rootfs/usr/local/sbin/apache-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
exec with-env apache2 -t 2>&1 | grep -qF "$@"
1 change: 1 addition & 0 deletions src/php/with-nginx/nginx-config.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ mkdir -p /etc/nginx \

# disable TLSv1.3 when not supported
if nginx-test 'invalid value "TLSv1.3"'; then
echo 'Disable TLSv1.3 because it is not supported in this Nginx version'
nginx-conf 'ssl_protocols' 'TLSv1.2'
fi

Expand Down
12 changes: 10 additions & 2 deletions tests/squash-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ platform="linux/${PLATFORM:-amd64}"
variant="${PHP_VARIANT:-}"
dockerfile="$BASE_DIR/src/${DOCKERFILE:-php/base-php.dockerfile}"
context=$(dirname $dockerfile)
s6_version=$(get_github_latest_tag "just-containers/s6-overlay" 1)

if [ ! -f "$context/meta.dockerfile" ]; then
cp -p "$BASE_DIR/src/php/meta.dockerfile" "$context/meta.dockerfile"
Expand All @@ -40,15 +41,22 @@ for version; do
--no-cache \
--tag "docker-php-$version-${DOCKERTAG:-$variant}:squashed" \
--platform "$platform" \
--build-arg S6_VERSION=$(get_github_latest_tag "just-containers/s6-overlay" 1) \
--build-arg S6_VERSION=$s6_version \
--build-arg PHP_VERSION=$version \
--build-arg PHP_VARIANT=$variant \
2>&1 | tee "$BASE_DIR/tests/logs/squash-$version-${DOCKERTAG:-$variant}.txt" &
done

# example
# build examples
# PLATFORM=arm64 DOCKERTAG=nginx DOCKERFILE=php/with-nginx.dockerfile PHP_VARIANT=fpm-alpine ./tests/squash-test.sh 5.6 8.4-rc
# PLATFORM=arm64 DOCKERTAG=apache DOCKERFILE=php/with-apache.dockerfile PHP_VARIANT=fpm ./tests/squash-test.sh 5.6 8.4-rc
# PLATFORM=arm64 DOCKERTAG=f8p DOCKERFILE=php/with-f8p.dockerfile PHP_VARIANT=zts ./tests/squash-test.sh 8.3
# PLATFORM=arm64 DOCKERTAG=unit DOCKERFILE=php/with-unit.dockerfile PHP_VARIANT=zts ./tests/squash-test.sh 8.2
# PLATFORM=arm64 DOCKERTAG=roadrunner DOCKERFILE=php/with-roadrunner.dockerfile PHP_VARIANT=zts-alpine ./tests/squash-test.sh 8.0 8.3
# PLATFORM=arm64 DOCKERTAG=bedrock DOCKERFILE=webapps/bedrock/bedrock.dockerfile PHP_VARIANT= ./tests/squash-test.sh 8.3

# run examples
# PLATFORM=arm64 DOCKERTAG=apache DOCKERFILE=php/with-apache.dockerfile PHP_VARIANT=fpm ./tests/squash-test.sh 5.6 8.3
# docker run --rm -p 443:443 -p 80:80 -e S6_VERBOSITY=3 docker-php-5.6-apache:squashed
# docker run --rm -p 443:443 -p 80:80 -e S6_VERBOSITY=3 docker-php-8.3-apache:squashed
# docker run --rm -p 443:443 -p 80:80 -e S6_VERBOSITY=3 shinsenter/php-archives:20240731-8.3-fpm-apache

0 comments on commit 39d7807

Please sign in to comment.