Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of multistage Docker build for grpc
FROM alpine:3.6 AS base
RUN apk add --no-cache python3 ca-certificates tzdata tini \
&& apk upgrade --no-cache
FROM base AS build
RUN apk add --no-cache \
python3-dev \
cython \
build-base
COPY requirements.txt /app/
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
FROM base
COPY --from=build /usr/lib/python3.6/site-packages/ /usr/lib/python3.6/site-packages/
WORKDIR /app/
COPY foo.py /app/
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/bin/env", "python3", "foo.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.