Skip to content

Instantly share code, notes, and snippets.

@mesmacosta
Created November 28, 2019 17:30
Show Gist options
  • Save mesmacosta/cbc4b92fe2c49155b66ce1fd16c816a5 to your computer and use it in GitHub Desktop.
Save mesmacosta/cbc4b92fe2c49155b66ce1fd16c816a5 to your computer and use it in GitHub Desktop.
Docker alpine python + grpc
FROM python:3.7-alpine as base
# install gcc and grpc dependencies
FROM base as builder
RUN apk add --update --no-cache \
gcc \
linux-headers \
make \
musl-dev \
python-dev \
g++
ENV GRPC_PYTHON_VERSION 1.15.0
RUN python -m pip install --upgrade pip
RUN pip install --install-option="--prefix=/install" grpcio==${GRPC_PYTHON_VERSION} grpcio-tools==${GRPC_PYTHON_VERSION} grpcio-reflection==${GRPC_PYTHON_VERSION} grpcio-health-checking==${GRPC_PYTHON_VERSION} grpcio-testing==${GRPC_PYTHON_VERSION}
FROM base
ENV GRPC_PYTHON_VERSION 1.15.0
COPY --from=builder /install /usr/local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment