5

I have a problem using Laradock and yarn with an inline docker exec command from "outside" the workspace container.

When I use it from inside the workspace container, everything is working 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, here 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 anything wrong ?

tk421
  • 5,288
  • 6
  • 22
  • 32
Okipa
  • 482
  • 4
  • 16

2 Answers2

4

I found the solution myself.
For those who encounter the same issue, just use docker exec following the example below, in order to get access to node or yarn :

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

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

Okipa
  • 482
  • 4
  • 16
0

try this

#apt-get install sudo -y
#sudo apt-get install apt-transport-https
#sudo apt-get install apt-transport-https
#apt-get remove node
#apt-get remove yarn
#curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
#sudo apt-get install -y nodejs
#curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
#echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
#sudo apt-get update && sudo apt-get install yarn
#apt-get remove node
#apt-get remove yarn
#curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
#sudo apt-get install -y nodejs
#curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
#echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
#sudo apt-get update && sudo apt-get install yarn
#yarn -v
1.13.0
#yarn install
Ryosuke Hujisawa
  • 1,763
  • 11
  • 14