You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/01/12 13:06:25 UTC

[GitHub] Fokko closed pull request #4483: [AIRFLOW-3673] Add official dockerfile

Fokko closed pull request #4483: [AIRFLOW-3673] Add official dockerfile
URL: https://github.com/apache/airflow/pull/4483
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.travis.yml b/.travis.yml
index f3320c03e0..43cb071e8c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -44,6 +44,7 @@ jobs:
       name: Flake8
       script: docker-compose --log-level ERROR -f scripts/ci/docker-compose.yml run airflow-testing /app/scripts/ci/run-ci.sh
       env: TOX_ENV=flake8
+
 cache:
   directories:
     - $HOME/.wheelhouse/
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000..354609bf6b
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,42 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM python:3.6-slim
+COPY setup.* /opt/airflow/
+COPY airflow /opt/airflow/airflow
+
+ARG AIRFLOW_HOME=/usr/local/airflow
+ARG AIRFLOW_DEPS="all"
+ARG PYTHON_DEPS=""
+ARG buildDeps="freetds-dev libkrb5-dev libsasl2-dev libssl-dev libffi-dev libpq-dev git"
+ARG APT_DEPS="$buildDeps libsasl2-dev freetds-bin build-essential default-libmysqlclient-dev apt-utils curl rsync netcat locales"
+
+WORKDIR /opt/airflow
+RUN set -x \
+    && export SLUGIFY_USES_TEXT_UNIDECODE=yes \
+    && apt update \
+    && if [ -n "${APT_DEPS}" ]; then apt install -y $APT_DEPS; fi \
+    && if [ -n "${PYTHON_DEPS}" ]; then pip install --no-cache-dir ${PYTHON_DEPS}; fi \
+    && pip install --no-cache-dir -e .[$AIRFLOW_DEPS] \
+    && apt purge --auto-remove -yqq $buildDeps \
+    && apt autoremove -yqq --purge \
+    && apt clean
+
+WORKDIR $AIRFLOW_HOME
+RUN mkdir -p $AIRFLOW_HOME
+COPY scripts/docker/entrypoint.sh /entrypoint.sh
+ENTRYPOINT ["/entrypoint.sh"]
+CMD ["--help"]
diff --git a/scripts/docker/entrypoint.sh b/scripts/docker/entrypoint.sh
new file mode 100755
index 0000000000..c5fa6fb0f9
--- /dev/null
+++ b/scripts/docker/entrypoint.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+set -e
+
+echo Starting Apache Airflow with command:
+echo airflow $@
+
+exec airflow $@


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services