[solved] Quality Tools (phpcs, phpmd, ...) not running with docker interpreter

Hello,

For a new project I have a docker container running with php-cli, composer and PHP CodeSniffer installed.

But when I try to configure PHPStorm to use CodeSniffer I get an error when I try to validate the phpcs setup.

OCI runtime create failed: container_linux.go:349: starting container process caused \"exec: \\\"phpcs\\\": executable file not found in $PATH\": unknown

As far as I can see the Docker CLI Interpreter is set up correctly (php version detected) and I can also run composer commands inside the container trough PHPStorm.

I have also tried entering the full codesniffer path (/root/.composer/vendor/bin/phpcs) but this has the same result.

Running phpcs from inside the container works fine.

Any ideas on what I could be doing wrong?

0

Please note that PhpStorm doesn't re-use the existing container, it starts a new one using the image.

Running phpcs from inside the container works fine.

Are quality tools installed in the image local_workspace:latest, or you installed them later by logging into the container?

0

Ok that explains a lot. I thought it reused the running container. I had indeed not yet added the tools to the Dockerfile while I was still trying to get it up and running. I did that now and it works.

Thanks a lot for the help Eugene Morozov!

0

Great, thank you for the update!

0
Avatar
Permanently deleted user

I had a similar `OCI runtime create failed` error after a dnf update on Fedora 34 which included a Docker update.

Downgrading containerd.io worked for me.

sudo dnf downgrade containerd.io
0

请先登录再写评论。