1

I'm trying to create a script that runs on google container optimized os that calls curl using toolbox but I want to pipe the results to jq by doing something like this:

sudo toolbox curl ... | sudo toolbox jq -r ".something"

but if I do this I get this error message:

Directory tree /var/lib/toolbox/root-gcr.io_google-containers_toolbox-20161110-02 is currently busy.

If I remove toolbox from the pipe (and just pipe to a command like grep that exists in the container) then everything works. But how can I pipe from curl to jq using toolbox?

Johan
  • 37,479
  • 32
  • 149
  • 237

1 Answers1

3

I solved this by doing:

sudo toolbox bash -c 'curl ... | jq -r ".something"'
Johan
  • 37,479
  • 32
  • 149
  • 237
  • Not fully applicable to this case (as you fixed the pipes) but if toolbox session is not stopped correctly, it could be killed with this combo `ps -ef | grep [t]oolbox | awk '{print $2}' | xargs sudo kill -9` – Jarek Mar 16 '23 at 12:40