Yarn is not on the way to Laradock worskpace when used in an inline docker exec command

I have a problem using Laradock and yarn using the docker exec built-in from outside the workspace container.

When I use it from the workspace container, everything works as expected:

 docker exec -it --user=laradock laradock_workspace_1 bash yarn -v 1.3.2 

When I try to use it from an inline command, this is what happens:

 docker exec -it --user=laradock laradock_workspace_1 yarn -v OCI runtime exec failed: exec failed: container_linux.go:296: starting container process caused "exec: \"yarn\": executable file not found in $PATH": unknown 

Am I doing something wrong?

+5
source share
1 answer

I found a solution myself.
For those facing the same problem, just use docker exec according to the example below to access the node or yarn:

 docker exec -it --user=laradock laradocknsn_workspace_1 bash --login -c "yarn -v" 

I found a solution here: https://gitlab.com/gitlab-org/gitlab-runner/issues/82

+3
source

Source: https://habr.com/ru/post/1275380/