Executing dockerized tools in phpstorm
I have recently converted my development environment to operate inside a container, and i have managed to get everything to work apart from one thing. external tools
Every time I try to execute the my function inside the docker container PHPStorm tells me the command is not found. I have it setup as a tool
<toolSet name="R3">
<tool name="Generate Template (Bootstrap)" description="Generate a single template" showInMainMenu="false" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false
" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="/bin/bash" />
<option name="PARAMETERS" value="-l $ProjectFileDir$/tools/r3/scripts/runfile-bootstrap.sh $FilePathRelativeToProjectRoot$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="Build All Templates (Bootstrap)" description="Build all template files" showInMainMenu="true" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="fal
se" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="/usr/bin/docker exec -it bonsai2 /var/www/bonsai/tools/r3/scripts/bootstrap-run-parallel.sh" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="/usr/bin" />
</exec>
</tool>
<tool name="Setup All Templates (Bootstrap)" description="Setup all templates" showInMainMenu="true" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" u
seConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/tools/r3/scripts/bootstrap-setup-ramdisc.sh" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$USER_HOME$/Public/Bonsai/tools/r3/scripts" />
</exec>
</tool>
</toolSet>
For example if i execute the following in the linux bash shell
/usr/bin/docker exec -it bonsai2 /var/www/bonsai/tools/r3/scripts/bootstrap-run-parallel.sh
It works just fine
But setup as an internal tool with the path set to /usr/bin
PHPStorm keeps telling me that the program does not exist, even though /usr/bin/docker is defiantly there.
Please sign in to leave a comment.
Hi there,
Please post your External Tool as screenshot (the way how it looks in IDE) so it will also show the error that IDE reports.
If I understand you correctly...
<option name="COMMAND" value="/usr/bin/docker exec -it bonsai2 /var/www/bonsai/tools/r3/scripts/bootstrap-run-parallel.sh" />
You cannot put whole command into "Command" field ... as it must be a path to the command/executable file only (/usr/bin/docker) and everything else must be in "Parameters" field (exec -it bonsai2 /var/www/bonsai/tools/r3/scripts/bootstrap-run-parallel.sh).