Last active
June 28, 2022 18:01
-
-
Save chenyaofo/900aae2d8d494f8baf96c1ebc321662b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax = docker/dockerfile:1.3 | |
FROM python:3.9-slim as builder | |
WORKDIR /app | |
ENV PYTHONDONTWRITEBYTECODE 1 | |
ENV PYTHONUNBUFFERED 1 | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends build-essential | |
RUN --mount=type=cache,target=/root/.cache/pip,id=pip_cache,sharing=locked \ | |
pip wheel --wheel-dir /wheels pycocotools | |
FROM python:3.9-slim | |
RUN --mount=type=bind,from=builder,source=/wheels,target=/wheels \ | |
pip install --no-cache /wheels/* | |
# doc from: https://yeasy.gitbook.io/docker_practice/buildx/buildkit | |
# build command: | |
# docker buildx build -t app --progress plain . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment