Created
July 28, 2017 21:52
-
-
Save NathanHowell/52983639fb0b7de6605ecd506d9b7817 to your computer and use it in GitHub Desktop.
Example of multistage Docker build for grpc
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
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