Skip to content

Instantly share code, notes, and snippets.

@andyi2it
Created September 17, 2022 19:36
Show Gist options
  • Save andyi2it/d6cc244e90f69cce065f73a2ebd93e16 to your computer and use it in GitHub Desktop.
Save andyi2it/d6cc244e90f69cce065f73a2ebd93e16 to your computer and use it in GitHub Desktop.
docker build pip optimization

Docker build pip optimization

Enable docker buildkit export DOCKER_BUILDKIT=1

Add # syntax = docker/dockerfile:1.3 at the top of the dockerfile

Add --mount=type=cache,target=/root/.cache before each pip install Eg: RUN --mount=type=cache,target=/root/.cache pip install --upgrade pip && pip install -e library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment