-
Notifications
You must be signed in to change notification settings - Fork 291
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
update docker images to use PHP 8 #1869
Conversation
8160699
to
40ae2c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking with quick local build, you need to update .docker/services.d/php-fpm/run
executable to php-fpm8
.
40ae2c1
to
6874c04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main image tested locally ✔️
After running some quick tests, the Alpine test image does not seem to provide a environment suitable to running tests, which may point to potential issues with the main image:
- the
test
targets depend on the thetranslate
target, which fails due to usingfind
'sexecdir
flag - 322 tests fail with PHP parsing errors (this may be related to the currently pinned PHPUnit version)
- 7 tests fail with errors related to filesystem permissions (IIRC this is not new and dates back to running test suites on Alpine images)
I'm attaching the output of:
$ vendor/bin/phpunit --bootstrap tests/bootstrap.php --testsuite unit-tests
for reference: tests.log
I also get these results with git clone -b docker-alpine-php8 https://github.com/shaarli/Shaarli
cd Shaarli
sudo docker build --no-cache -f tests/docker/alpine316/Dockerfile .
# Successfully built 8b37e75ac81f
sudo docker run -it --rm --mount type=bind,source=/home/user/Shaarli,destination=/shaarli --entrypoint=/bin/sh 8b37e75ac81f
/shaarli # make test
|
After setting in "require-dev": {
...
"phpunit/phpunit": "^8.0 || ^9.0" and running
|
- tests are failing with php8 and phpunit 7.x - ref. #1869
Great job! For the LDAP error, it's probably just missing The other issues seem all related to permissions. My guess is that the tests run as root, so it doesn't raise permission issues like it would with a regular user. I'm not sure what's the best approach here. Depending on how easy it is to fix, since the main image build is broken, it could maybe make sense to merge it first and fix the tests Dockerfiles later? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I did similar work for another project to setup reference Debian and Ubuntu environments with Docker and run builds as an unprivileged user: https://github.com/virtualtam/ccache_exporter/tree/main/integration
Agreed, I'll see how I can port the aforementioned work so we can run PHP tests using unprivileged users 👍 |
I just tried out this PR to fix my personal container build of Shaarli, so far everything seems to work, good job! |
- python2 no longer available in alpine 3.16 - ref. #1048
- squizlabs/php_codesniffer[3.0.0, ..., 3.7.1] require ext-xmlwriter * -> it is missing from your system. Install or enable PHP's xmlwriter extension.
1d452ef
to
5177e03
Compare
-> #1890
Let's merge it as-is and tackle remaining problems in separate issues. Thanks for your help. |
docker build .