Skip to content

Instantly share code, notes, and snippets.

@vfalies
Last active June 23, 2022 19:46
Show Gist options
  • Save vfalies/deb91f8a40b650cc6c68898f71bdfcbe to your computer and use it in GitHub Desktop.
Save vfalies/deb91f8a40b650cc6c68898f71bdfcbe to your computer and use it in GitHub Desktop.

Create a /bin/sh wrapper to your docker container and then point PHP Intellisense at the wrapper:

#!/bin/sh

docker run \
    --rm \
    -i \
    --network=host \
    -v "$HOME":"$HOME":ro \
    -u $(id -u) \
    -w "$PWD" \
    vfac/envdevphpbase:7.2-cli \
    php "$@"

exit $?

Please note you will need to map in any volumes you require, i've assumed your $HOME dir here. Also you must use the interactive flag -i.

{
  "php.executablePath": "/somewhere/php7wrapper",
  "php.suggest.basic": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment