Skip to content

Instantly share code, notes, and snippets.

@mlabouardy
Created April 16, 2019 18:43
Show Gist options
  • Select an option

  • Save mlabouardy/671f6cf721007e338e2d861e7b7a6a33 to your computer and use it in GitHub Desktop.

Select an option

Save mlabouardy/671f6cf721007e338e2d861e7b7a6a33 to your computer and use it in GitHub Desktop.
Install BigQuery on Docker
FROM alpine:latest
LABEL Author mlabouardy
ENV SDK_URL https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.zip
ENV CLOUDSDK_PYTHON_SITEPACKAGES=1
ENV PATH /google-cloud-sdk/bin:$PATH
ENV HOME /
ENV BUILD_DEPS \
g++ \
gcc \
linux-headers \
wget \
build-base \
libressl-dev \
python2-dev \
libffi-dev \
unzip \
ca-certificates \
py2-pip \
gnupg \
musl-dev
RUN apk --update add openssl
RUN set -x \
&& apk add --no-cache --virtual .persistent-deps \
rsync \
bash \
curl \
dateutils \
ca-certificates \
libressl \
libressl2.7-libcrypto \
libressl2.7-libssl \
coreutils \
openssh-client \
python2 \
py-openssl \
&& apk add --no-cache --virtual .build-deps \
$BUILD_DEPS \
&& pip install --upgrade pip crcmod setuptools awscli \
&& mkdir -p /etc/gcloud \
&& wget --no-check-certificate $SDK_URL \
&& unzip google-cloud-sdk.zip \
&& rm google-cloud-sdk.zip \
&& ./google-cloud-sdk/install.sh --path-update=true --bash-completion=true --rc-path=/.bashrc --additional-components bq gsutil \
&& ln -s /lib /lib64 \
&& rm -rf /tmp/* \
&& rm -rf /var/cache/apk/* \
&& apk del .build-deps
COPY . .
RUN pip install -r requirements.txt
RUN chmod +x entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment