Created
July 6, 2023 06:39
-
-
Save febridev/fca5323903dff4e0cfb5ea3e73f9e2de to your computer and use it in GitHub Desktop.
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
# First-time build can take upto 10 mins. | |
FROM apache/airflow:2.2.3 | |
ENV AIRFLOW_HOME=/opt/airflow | |
ENV KAGGLE_USERNAME=<username> | |
ENV KAGGLE_KEY=<kaggle-key> | |
USER root | |
RUN apt-get update -qq && apt-get install vim -qqq && apt-get install wget -qq | |
# git gcc g++ -qqq | |
COPY requirements.txt . | |
RUN python -m pip install --upgrade pip | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Ref: https://airflow.apache.org/docs/docker-stack/recipes.html | |
SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"] | |
ARG CLOUD_SDK_VERSION=322.0.0 | |
ENV GCLOUD_HOME=/home/google-cloud-sdk | |
ENV PATH="${GCLOUD_HOME}/bin/:${PATH}" | |
RUN DOWNLOAD_URL="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz" \ | |
&& TMP_DIR="$(mktemp -d)" \ | |
&& curl -fL "${DOWNLOAD_URL}" --output "${TMP_DIR}/google-cloud-sdk.tar.gz" \ | |
&& mkdir -p "${GCLOUD_HOME}" \ | |
&& tar xzf "${TMP_DIR}/google-cloud-sdk.tar.gz" -C "${GCLOUD_HOME}" --strip-components=1 \ | |
&& "${GCLOUD_HOME}/install.sh" \ | |
--bash-completion=false \ | |
--path-update=false \ | |
--usage-reporting=false \ | |
--quiet \ | |
&& rm -rf "${TMP_DIR}" \ | |
&& gcloud --version | |
WORKDIR $AIRFLOW_HOME | |
COPY scripts scripts | |
RUN chmod +x scripts | |
USER $AIRFLOW_UID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment