-
-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yiisoftware/yii2-php:7.4-fpm + mac m1 architecture #148
Comments
What is special about this image |
https://hub.docker.com/layers/php/library/php/7.4-fpm/images/sha256-debf3848d5407dbdd45c2c01844f7ccc4e35902a0f6ff557dbc3e634b60e87e6?context=explore |
How can we build an image for a specific processor-arch with Current build instruction: https://github.com/yiisoft/yii2-docker/blob/master/.github/workflows/docker-image.yml#L120 |
Rebuild the image by pulling up the updated base images |
We're doing nightly builds: https://hub.docker.com/repository/docker/yiisoftware/yii2-php/tags?page=1&ordering=last_updated - so they should be the latest images. |
Then why here https://hub.docker.com/r/yiisoftware/yii2-php/tags only one OS/ARCH |
I have no experience with multi-platform builds. You can either specify that in the Or Which one would be needed (or both)? Which platforms should we support? CC: @yiisoft/core-developers Might use much more build resources. We also need to check if GitHub actions support other platforms. PRs also in WIP welcome, I won't have much time for this. |
linux/arm64/v8 |
multi-arch builds would be appreciated as Prerequisite:
Steps to reproduce: mkdir web
echo 'It works!' > web/index.html
# test php:7.4-apache
docker run --name test_php -d -v $PWD/web:/var/www/html/ -p 8080:80 php:7.4-apache
curl http://localhost:8080
# It works!
# test php:7.4-apache with ssl module enabled
cat <<EOF > Dockerfile-php
FROM php:7.4-apache
RUN a2enmod ssl
EOF
docker build -t test_php_ssl -f Dockerfile-php .
docker run --name test_php_ssl -d -v $PWD/web:/var/www/html/ -p 8081:80 test_php_ssl
curl http://localhost:8081
# It works!
# test yiisoftware/yii2-php:7.4-apache
docker run --name test_yii2 -d -v $PWD/web:/app/web -p 8082:80 yiisoftware/yii2-php:7.4-apache
curl http://localhost:8082
# It works!
# test yiisoftware/yii2-php:7.4-apache with ssl module enabled
cat <<EOF > Dockerfile-yii2
FROM yiisoftware/yii2-php:7.4-apache
RUN a2enmod ssl
EOF
docker build -t test_yii2_ssl -f Dockerfile-yii2 .
docker run --name test_yii2_ssl -d -v $PWD/web:/app/web -p 8083:80 test_yii2_ssl
curl http://localhost:8083
# curl: (7) Failed to connect to localhost port 8083: Connection refused
docker logs test_yii2_ssl
# usermod: no changes
# AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.4. Set the 'ServerName' directive globally to suppress this message
# [Mon Jul 11 13:41:02.758036 2022] [core:emerg] [pid 1] (95)Operation not supported: AH00023: Couldn't create the mpm-accept mutex
# (95)Operation not supported: could not create accept mutex
# AH00015: Unable to open logs
# clean up
docker rm -f test_php test_php_ssl test_yii2 test_yii2_ssl
docker rmi test_php_ssl test_yii2_ssl |
I'd recommend to add this to the docs: https://github.com/yiisoft/yii2-docker/tree/master/docs We're building with GitHub Actions, so we're bound to their infrastructure. |
Hello! This is how I managed to build a custom php image for several architectures:
Reference: https://github.com/zemkogabor/php-file-service#docker We can use the same in the github action: https://blog.thesparktree.com/docker-multi-arch-github-actions |
any updates on this? |
I couldn't figure out how to do that with GH-actions, PRs still welcome. |
My biggest problem with the arm64 build is that it's very slow on Github. Currently, Github does not have any arm64 architecture build servers. A possible workaround is to separate the builds into separate actions, so that the amd64 can be ready quickly, while the arm64 may take more than an hour to complete. Here's the example: AventailLtd/docker-php@14d4ed5 Returning to the PR. If I have a bit more time, I'll try to apply buildx to the Yii2 docker, if successful locally, I'll open a PR, but I can't promise anything at the moment. |
is it possible to do something on the client (developer) side to have this working? I don't have any experience on GH actions so can't help here |
Can you build an image for the same architecture for m1 processors? In principle, I was able to rebuild locally by taking the original dockerfile and adding PHP_BASE_IMAGE_VERSION instead php:7.4.28-fpm@sha256:debf3848d5407dbdd45c2c01844f7ccc4e35902a0f6ff557dbc3e634b60e87e6 and getting a 10-fold increase in productivity. I think you will be able to do it more correctly.
The text was updated successfully, but these errors were encountered: