Measures the average execution time (N=20) of a Ruby program printing out "Hello, world!" launched via "docker run", "docker exec" and without container management overhead.
-
time docker run ruby:latest ruby -e "puts 'Hello, world!'"
-
time docker exec $CID ruby -e ...
-
docker run ruby:latest /bin/bash -c "time ruby -e ..."
I wanted to know how slow it would be to spawn a new Docker container to run a CGI script. Unfortunately, "docker run" takes almost 0.5s to complete, whereas "docker exec" takes 0.1s. If container management is not taking into account, it runs in less than 0.05s.