Closed walle closed 9 years ago
Interesting suggestion @walle!
I have little experience with Docker so bear with me. For example I had not considered you could use it to run CLI apps which generates output to the local file system. Very nifty!
I consider the wsdl2phpgenerator
dependency chain short and not very strict. We currently require PHP 5.3 and the SOAP extension. This is required when using the tool anyway. Thus at the moment I am not sure what a Docker image brings to the table. It would also be a contribution that I personally would have a hard time supporting going forward.
However going forward this could allow us to bump our version requirements for code generation - require PHP 5.6 for example - without leaving everybody entirely behind. We would still have to ensure that the generated code is usable on the supported PHP versions.
Regarding choice of base image it seems like Docker provides official PHP images without Apache etc. Could they be of any use?
Yes, it's a nifty feature. I don't have much experience with docker either, but it is really growing on me now when I've used it a bit.
Yes, I don't know if it really brings that much to the table, if you are about to develop something that will use the generated code you will eventually have to install the dependencies. I guess I'm lagging behind somewhat in PHP development. In the "good" old days between 5.2 and 5.3 I think it was when namespaces were introduced. Then it would have been good to be able to generate the code and look it over without having to change your development machine (because I remember that as being kind of tricky, I guess it is easier now), e.g. if you were developing something in 5.2. But nowadays I get the impression that version bumps goes a bit smother and that developers stay up to date more. So right now I guess the only use this would have is, "I want to see what kind of code this tool generates.". It made a lot more sense for gimli to have a docker file like this, as it is a tool that generates php documents, not code :)
Yes, we could close this for now and take it up again if a version bump brings a lot of changes.
Yes, that would be the images to use, they are locked at version also if I'm not mistaken.
I've not been involved in the project for some time now, but last week I wrote a Dockerfile for my project gimli, https://registry.hub.docker.com/u/walle/gimli/. And it gives a nice way to run the project without versioning issues and such. So I thought that I might make one for this project too.
I don't know if people want this feature, so I'm making a pull request. Please comment to make your opinion heard. In this pull request is a Dockerfile, the foundation for one. It uses another docker repo for the base system and it runs the 2.5.5 version of wsdl2phpgenerator-cli since the 3.0.0 phar was not released yet. I think we should use a clean ubuntu image and just install the parts needed, this gives us freedom to select PHP version and so, right now we are at the mercy of the version in the darh/php-essentials repo. 5.5 at the time of writing. The version of wsdl2phpgenerator-cli should also be bumped when the new release is available.
If you think this is a good contribution, we also have to figure out how to host this on https://registry.hub.docker.com, in a good way, so it's easy to install and run. The command should just be
But for now, before it's in the registry, it has to be built locally first e.g.
A short explanation of the command, it runs the wsdl2phpgenerator phar inside a docker container, so to be able to get the generated files we need to mount a directory inside the container so we can write to it. All arguments after the image id goes to wsdl2phpgenerator-cli so the -i and -o flags in this case. The mounting is done with the -v flag to docker
-v /home/walle/wsdl2phptest:/tmp/wsdl2php
mounts the directory wsdl2phptest in my home folder to the wsdl2php direcory in the containers /tmp directory. So the command writes the output to /tmp/wsdl2php and it ends up in my home folder.And again, thank you for your work with this project @kasperg