Super Slow Docker Build

后端 未结 1 874
孤城傲影
孤城傲影 2021-01-12 02:16

I think I\'m going to go crazy. I\'ve searched all over and can\'t seem to find a working solution both here on Stack, GitHub and other far reaches of the interwebs.

<
1条回答
  •  清酒与你
    2021-01-12 03:08

    This is from your build context (that's often the directory where you run your build, but can be overridden as you've done in the compose file). You have a large number of files, or large files, in the context directory that is sent before performing the build.

    You can use .dockerignore which has a nearly identical format to .gitignore to exclude files from being sent on build. And with BuildKit (enabled if you export DOCKER_BUILDKIT=1 in recent versions of docker) it will only send context when you explicitly copy files and then only when those files have changed from what is available in the cache.

    For more on the build context, see: https://docs.docker.com/engine/reference/commandline/build/

    There's also the best practices: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/

    0 讨论(0)
提交回复
热议问题