Last active
March 31, 2021 15:35
-
-
Save kd2718/f774e134843c7b7304a80276efe9f03a to your computer and use it in GitHub Desktop.
First Try Dockerfile
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
## Bad Example | |
# VERSION 1.10.9 | |
# AUTHOR: Matthieu "Puckel_" Roisil | |
# DESCRIPTION: Basic Airflow container | |
# BUILD: docker build --rm -t puckel/docker-airflow . | |
# SOURCE: https://github.com/puckel/docker-airflow | |
#FROM apache/airflow:2.0.0-python3.8-build | |
FROM apache/airflow:2.0.1-python3.8 | |
USER root | |
LABEL maintainer="kd2718" | |
# Never prompt the user for choices on installation/configuration of packages | |
ENV DEBIAN_FRONTEND noninteractive | |
ENV TERM linux | |
# Airflow | |
ARG AIRFLOW_VERSION=2.0.0 | |
#ARG AIRFLOW_USER_HOME=/opt/airflow/ | |
ARG AIRFLOW_DEPS="azure" | |
ARG PYTHON_DEPS="opentelemetry-api opentelemetry-instrumentation airflow-hdinsight" | |
ENV AIRFLOW_HOME=${AIRFLOW_USER_HOME} | |
# Define en_US. | |
ENV LANGUAGE en_US.UTF-8 | |
ENV LANG en_US.UTF-8 | |
#ENV LC_ALL en_US.UTF-8 | |
ENV LC_CTYPE en_US.UTF-8 | |
ENV LC_MESSAGES en_US.UTF-8 | |
# Disable noisy "Handling signal" log messages: | |
# ENV GUNICORN_CMD_ARGS --log-level WARNING | |
RUN apt update && \ | |
apt upgrade -yqq && \ | |
curl -sL https://aka.ms/InstallAzureCLIDeb | bash && \ | |
az upgrade --all -y && \ | |
apt install g++ unixodbc-dev -yqq | |
# update password | |
RUN echo "airflow:airflow" | chpasswd \ | |
&& adduser airflow sudo | |
# install azure cli | |
#RUN apt-get install ca-certificates curl apt-transport-https lsb-release gnupg && \ | |
#curl -sL https://packages.microsoft.com/keys/microsoft.asc | \ | |
#gpg --dearmor | \ | |
#tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null && \ | |
#AZ_REPO=$(lsb_release -cs) \ | |
#echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \ | |
#tee /etc/apt/sources.list.d/azure-cli.list && \ | |
USER airflow | |
RUN pip install --upgrade pip setuptools wheel && \ | |
pip install 'ipython' \ | |
apache-airflow[azure,mssql,odbc] \ | |
pyodbc \ | |
python-dotenv \ | |
#'azure-mgmt-hdinsight~=1.5.1' \ | |
#pip install 'msrestazure~=0.6.3' && \ | |
#'apache-airflow>=1.10.10,<=2.*', | |
#'azure-storage-blob==2.1.0', | |
#'azure-storage-common==2.1.0', | |
#'azure-storage-nspkg==3.1.0', | |
#'azure-datalake-store', | |
#pip install 'paramiko' && \ | |
#pip install 'sshtunnel' && \ | |
#pip install 'parameterized'&& \ | |
#pip install 'alchemy-mock' && \ | |
'azure-synapse'\ | |
'azure-synapse-monitoring==0.1.0' \ | |
'azure-synapse-spark==0.4.0' | |
#'azure-mgmt-hdinsight' | |
#'aztk' | |
#pip install airflow-hdinsight --no-deps | |
USER root | |
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ | |
#Download appropriate package for the OS version | |
#Choose only ONE of the following, corresponding to your OS version | |
#Debian 10 | |
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ | |
apt update && \ | |
ACCEPT_EULA=Y apt-get install msodbcsql17 -yqq && \ | |
# optional: for bcp and sqlcmd | |
ACCEPT_EULA=Y apt-get install mssql-tools -yqq && \ | |
#source ~/.bashrc && \ | |
# optional: for unixODBC development headers | |
apt-get install unixodbc-dev g++ -yqq | |
USER airflow | |
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile && \ | |
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc | |
#COPY script/entrypoint.sh /entrypoint.sh | |
#COPY config/airflow.cfg ${AIRFLOW_USER_HOME}/airflow.cfg | |
#RUN chown -R airflow: ${AIRFLOW_USER_HOME} | |
EXPOSE 8080 5555 8793 | |
USER airflow | |
#USER root | |
#WORKDIR ${AIRFLOW_USER_HOME} | |
#ENTRYPOINT ["/entrypoint.sh"] | |
#CMD ["webserver"] | |
CMD ['SLEEP 10'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment