As PHP-CS-Fixer is a super helpful tool, I'm using it on different continuous integration platforms, I wonder if PHP-CS-Fixer would like to provide official Docker image (there are some dated on Docker Hub), so it'd be super easy to integrate it with GitLab CI, Drone CI, and many other Docker-based CI platforms.
If this is acceptable, I'm very happy to send the pull request for its Dockerfile and help publish the Docker image on Docker Hub, please let me know what's your thoughts.
Thanks again for providing such an awesome tool 😄
Hi and thanks for using the tool and the kind words! :D
Your idea sounds very nice to me, however I don't know what the implications would in terms of maintenance (having a dated image here wouldn't help) . Therefore I'm curious about the opinions of others on this well.
what's wrong with most common docker image for php tools - https://hub.docker.com/r/jakzal/phpqa/ ?
why to redesign the wheel?
@SpacePossum it can be hooked between Docker Hub and GitHub so the build can be fully automatically.
@keradus there is no wrong, but what if I just want php-cs-fixer? We'll download a 80~180 MB sized (much larger after decompression) Docker image for 90% up things we don't need and in fact we can just download less than 10MB to save time, bandwidth and the computing resource to have a faster CI performance. I think it'll be very good if we can have an image for just php-cs-fixer, phpqa image is awesome, but it's too fat for me. The familiar thing, php-cs-fixer may not be versioned so fast, in the common case I wanna use the latest php-cs-fixer I can use the latest version from Docker Hub, but the integrated phpqa? No, the latest will bring me many updates not fit my need, but just waste the time and resource. Will this sound more reasonable now?
I don't believe you gonna have fully-working php & PHP CS Fixer in linux image less than 10MB ;)
for that, why not use phar release? 1mb only
I must be drunk, it should be 50~60MB, not 10MB, but still much smaller than phpqa image, just wondering if it's possible to have an official image for just php-cs-fixer, will respect your opinion, thanks.
For now I will keep this issue open, let us see if there would be more request on it, if so, we would create/maintain one.
If you don't mind, I can send a pull request to add a Dockerfile first, it won't mean to provide the docker image, but could help those who want to build a docker image save some time.
as there was nobody from community to support the idea, I'm :-1: on that currently
Next issue, outcome of PHP CS Fixer depends not only on used ruleset, but also on version of used PHP.
Docker img would hide that, end running PHP CS Fixer via docker's PHP 7.1 to fix PHP 5.6 based project could be a disaster.
So that means it should be delivered with different major PHP versions, and phpqa will have the same issue with PHP-CS-Fixer.
having matrix of PHP version vs PHP CS Fixer version would produce super huge number of dockers.
phpqa is not our image, we don't officially support it
Yeah I know, no offense, if you'd like to provide with different PHP versions, I think it'll fine to only provide the major living versions, which means 4 only:
Since the official PHP docker image also have the 4 major versions only, we could and we should directly use the official images as base image, the effort won't be huge :)
about 50% of users are still using <2.3 version of PHP CS Fixer (vide https://repo-stats.github.io)
about 30% of users are using 2.0-2.2, as they cannot update to use newer PHP engine.
Fragmentation is an issue for PHP CS Fixer, it's even bigger fragmentation than for used PHP version itself.
And as we care for our users we do have LTS for lower PHP version, which one may need to run under that lower PHP engine.
While I do really like docker, it's not a tool to do everything.
As there were no support for this idea from community, either here in the thread, nor on our gitter channel, I'm closing the thread. Official image won't happen, at least not now.
If one wants to use PHP CS Fixer via docker, you still can build your own docker file (it's not rocket science), or simply use phpqa image.
Wow, didn't know the repo-stats service for packagist, thanks!
it's on github, if you would find sth that could be improved/changed (which wouldn't be that hard), simply raise PR for it ;) https://github.com/repo-stats/repo-stats.github.io
I'd very much like an official docker image. There are already a few homemade on hub.docker.com, but none of them provides the correct implementation of the version matrix.
how would you describe "correct implementation of the version matrix" ?
Basically: supported php-cs-fixer versions * official PHP docker images.
A good example is how the PHP images themselves are maintained, via some automation scripts which enable the delivery of a great number of variants.
I realise this is not a trivial effort, but it's one worth to take, imo. Static analysers are a very good candidate for Docker packeting, since their usage very often involves a CI environment.
One particular issue a Docker distribution would solve, to me personally, is that I can't run a standalone php-cs-fixer command in a git hook, because my host dev environment doesn't have a matching PHP version with the project I'm working on. I end up having to hack my way around this, but a simple e.g. docker run php-cs-fixer:2-php7 would be much more convenient!