Created
August 30, 2024 16:29
-
-
Save greenbicycle/3c5db0aab41fa5420dbce5a82a76f6d7 to your computer and use it in GitHub Desktop.
Run a specific version of php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: php8.3-cli.sh <command> | |
CONTAINER=php:8.3-alpine | |
docker run -it --rm --name php83 \ | |
-v "$PWD":/code \ | |
-v ~/.composer:/root/.composer \ | |
-v ~/bin:/usr/local/sbin \ | |
-w /code \ | |
$CONTAINER $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The volumes aren't required, but will give you more functionality, since the container will not have anything installed in it automatically.
In my bin/ directory, I have things like composer, and phpcs, etc.