When I tried to put the latest version of google-cloud-bigquery
into the latest version of python * alpine, the installation failed with the following error. Finally, when I made it like` Dockerfile after modification, it was safe. I was able to install it.
Dockerfile
FROM python:3.9.0-alpine3.12
RUN apk --update add \
curl \
bash
RUN apk --update add tzdata && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
COPY ./requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN curl -sSL https://sdk.cloud.google.com | bash
ENV PATH $PATH:/root/google-cloud-sdk/bin
RUN mkdir -p /src
FROM python:3.9.0-alpine3.12
RUN apk --update add \
curl \
gcc \
musl-dev \
linux-headers \
build-base \
libffi-dev \
bash
RUN apk --update add tzdata && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
COPY ./requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN curl -sSL https://sdk.cloud.google.com | bash
ENV PATH $PATH:/root/google-cloud-sdk/bin
error: command 'gcc' failed: No such file or directory
fatal error: limits.h: No such file or directory
fatal error: ffi.h: No such file or directory
requirements.txt
google-cloud-bigquery==2.4.0
Dockerfile
FROM python:3.9.0-alpine3.12
RUN apk --update add \
curl \
gcc \
musl-dev \
linux-headers \
build-base \
libffi-dev \
bash
RUN apk --update add tzdata && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
COPY ./requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN curl -sSL https://sdk.cloud.google.com | bash
ENV PATH $PATH:/root/google-cloud-sdk/bin
RUN mkdir -p /src
FROM python:3.9.0-alpine3.12
RUN apk --update add \
curl \
gcc \
musl-dev \
linux-headers \
build-base \
libffi-dev \
bash
RUN apk --update add tzdata && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
COPY ./requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN curl -sSL https://sdk.cloud.google.com | bash
ENV PATH $PATH:/root/google-cloud-sdk/bin