1

I'm trying to create a make command to collect docker stats into some csv files.

I have defined the command as below, with a while loop to collect every 5 seconds.

docker.memory:
    while [ $(gdate -u +%s) -le $(endtime) ]
    do
        $(shell docker stats --no-stream --format "table ..." > dockerstats)
        $(shell sleep 5)
    done

However, the command fails with error:

Makefile:xx: *** commands commence before first target.  Stop.

Could anyone please advise?

Lee
  • 2,874
  • 3
  • 27
  • 51
  • See this question: https://stackoverflow.com/questions/4713663/gnu-make-yields-commands-commence-before-first-target-error – fireshadow52 Sep 02 '22 at 01:52

0 Answers0