I wonder what happened in cold start? Is the docker pull image a part of the cold start latency?
If I already have an image downloaded in my disk. Say a simple image to run a C++ fibonacci program. Here is my dockerfile:
FROM gcc:10 RUN mkdir /usr/src/myapp COPY fib.c /usr/src/myapp WORKDIR /usr/src/myapp RUN gcc fib.c -o fib CMD ./fib
So which lines were executed in the container startup phase, and which lines of this dockerfile run in execution phase. I though at least the CMD ./fib (execute the compiled binary ./fib) is run during the execution phase. Not sure with the other lines.
After docker run, I used docker inspect command to get more information about time. I found the Created time and StartedAt time. I thought the subtraction of StartedAt and Created time is cold start latency, but I am not sure with that.
Because I have tried to change from COPY fib.c /usr/src/myapp to COPY a much larger file (1GB) to the /usr/src/myapp directory. I got a larger docker image, but the subtraction of StartedAt and Created time bacially does not change. I also dont notice any time difference when docker run these two images.
I apologize for the lengthy post, and thank you so much for saving this Docker newbie