-
Couldn't load subscription status.
- Fork 401
Add Dockerfile for development #945
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
Conversation
- Dockerfile to build an image with the FakerPHP dev dependencies. Allows devs to work on the repo without having to install any dependencies (e.g. php, composer, make) on the host machine.
Dockerfile
Outdated
| gzip \ | ||
| unzip | ||
|
|
||
| ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ |
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.
Could we use the same mechanic here as with composer: copying the script from the docker image
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.
Yeah, it would be fine. ADD needs to download the file each time to calculate the hash and decide if it should invalidate the cache, using the image would skip the downloading part which is better.
We just need to add some info in the README warning about potentially stale images and the need to use build --pull as needed. Could also use something like watchtower but since this is just for local development I don't see a need
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.
Removed the ADD and added the extension-installer image
- Add extension-install image instead of using ADD. - Remove gzip since it's not needed. - Change USERNAME to FakerPHP.
|
Is it an idea to also integrate our tooling to run via docker instead? Since right now, what is a solid way to run stuff without complex cli commands? |
@pimjansen What do you mean by this?
After building the image and adding an alias, the commands are pretty simple, e.g.: Also, do you want me to change the target branch of this PR to |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions. |
What is the reason for this PR?
Dockerfile to build an image with the FakerPHP dev dependencies.
It doesn't impact end users, it just improves the DX (Developer Experience) for anyone that wants to contribute to the repo without having to worry about installing any dependency (e.g. php, composer, make) on the host machine.
You just need to:
docker build -t php8.3-composer .alias php8.3="docker run -it --rm -v .:/app -w /app php8.3-composer"php8.3 make csNote:
ADDis meant to facilitate the installation of extensions. You can verify that the script is even mentioned in the README of the offical PHP image:8.3since there seems to be a dependency that requires a max of 8.3.X. Composer defaults tolatest. You can override these defaults usingdocker build --build-args, allowing you to have multiple versions to work with (by setting multiple alias).Let me know what you think, I will add some info to the README if you find this useful.