Кэш сборки в реестре buildkit
Хранит полный кэш слоёв в реестре для CI; mode=max кэширует промежуточные стадии
docker buildx build --cache-to type=registry,ref=<reg>/cache,mode=max --cache-from type=registry,ref=<reg>/cache -t <reg>/<name> --push .
more buildkit
all 4 commands →
Постоянный cache-mount в RUN
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
Монтирование секрета при сборке
RUN --mount=type=secret,id=npmrc,target=/root/.npmrc npm ci
Проброс SSH для приватных репозиториев
docker buildx build --ssh default -t <name> . # Dockerfile: RUN --mount=type=ssh git clone git@host:repo