Sign inSign up

keelerrussell/docker-build-profiler

By keelerrussell

•Updated over 5 years ago

Image which uses docker-in-docker + buildkit + Jaeger to profile docker build times.

Image
0

455

keelerrussell/docker-build-profiler repository overview

⁠docker-build-profiler

Use this to profile your docker builds and figure out what's making them slow.

⁠Instructions

  1. Run this image.
docker run -it -d --privileged \
     --name build-profiler \
     -p16686:16686 \
     keelerrussell/docker-build-profiler
  1. Make a directory for your project's docker build context and copy your stuff (Dockerfile, sources, assets, etc.) into the container.
cd ~/your/project
docker exec -it build-profiler mkdir project
docker cp . build-profiler:/workspace/project
  1. Build your image with buildctl.
docker exec -it build-profiler buildctl build \
     --frontend=dockerfile.v0 \
     --local context=project \
     --local dockerfile=project
  1. View the build profile results in Jaeger at http://localhost:16686⁠.
    • Alternatively, curl the results out: curl -s http://localhost:16686/api/traces\?service\=buildctl | jq '.'.

Keep the container running and repeat steps 2 through 4 as many times as you like.

Tag summary

Content type

Image

Digest

Size

207.3 MB

Last updated

over 5 years ago

docker pull keelerrussell/docker-build-profiler