0

I am trying to write a Dockerfile which has an infinite loop with some commands/work inside which will cause the data stats (memory utilization, cpu utilization, PIDs block IO, etc) to increase as the container keeps running. I need this because I am trying to simulate a metric collection process for docker containers so I would like to have some containers running that will keep using resources and show increases when polling 'docker stats'. Currently, I have figured out different tricks for running infinite loops but am not sure how to make the resource usage stats increase. Thanks!

1 Answers1

0

Maybe you can write a simple shell script to run an infinite loop and use it in your Dockerfile.

Try this How to create a CPU spike with a bash command

CreditCard
  • 26
  • 1
  • I have been trying to write a shell script which is downloading a file from url in an infinite loop and then using it in my Dockerfile with CMD but I can't get it to work. Do you have recommendations on what to put in the shell script to show the resources being increasingly used? – Sumeet Chaudhari Aug 09 '22 at 04:40