<commit_before># VERSION 0.0.1
# AUTHOR: <NAME>
# DESCRIPTION: Docker airflow with ECR registry and DooD (Docker outside of Dkr)
# BUILD: docker build --rm -t wongwill86/air-tasks .
# SOURCE: https://github.com/wongwill86/air-tasks

# Compile AWS credential helper
FROM golang:1.8.3
WORKDIR /go/src/github.com/awslabs/
RUN git clone https://github.com/awslabs/amazon-ecr-credential-helper.git
WORKDIR /go/src/github.com/awslabs/amazon-ecr-credential-helper
RUN make

FROM puckel/docker-airflow:1.8.1
MAINTAINER wongwill86

ARG AIRFLOW_HOME=/usr/local/airflow
ENV AIRFLOW_HOME ${AIRFLOW_HOME}
ENV AIRFLOW_USER airflow

USER root
RUN curl -fsSL https://get.docker.com/ | sh
RUN pip install docker-py
RUN apt-get install sudo

RUN apt-get clean \
    && rm -rf \
        /var/lib/apt/lists/* \
        /tmp/* \
        /var/tmp/* \
        /usr/share/man \
        /usr/share/doc \
        /usr/share/doc-base

RUN usermod -aG docker airflow

# unfortunately this is required to update the container docker gid to match the
# host's gid, we remove this permission from entrypoint-dood.sh script
RUN echo "airflow ALL=NOPASSWD: ALL" >> /etc/sudoers
WORKDIR ${AIRFLOW_HOME}/.docker

# this is to enable aws ecr credentials helpers to reauthorize docker
RUN echo '{\n    "credsStore": "ecr-login"\n}' > config.json
# copy the built docker credentials module to this container
COPY --from=0 \
    /go/src/github.com/awslabs/amazon-ecr-credential-helper/bin/local/docker-credential-ecr-login \
    /usr/local/bin

COPY deploy/scripts/entrypoint-dood.sh /entrypoint-dood.sh
COPY deploy/config/airflow.cfg ${AIRFLOW_HOME}/airflow.cfg

RUN chown -R airflow: ${AIRFLOW_HOME}

USER airflow
WORKDIR ${AIRFLOW_HOME}<commit_msg>ugh multistage not supported in dockerhub yet only docker cloud<commit_after># VERSION 0.0.1
# AUTHOR: <NAME>
# DESCRIPTION: Docker airflow with ECR registry and DooD (Docker outside of Dkr)
# BUILD: docker build --rm -t wongwill86/air-tasks .
# SOURCE: https://github.com/wongwill86/air-tasks

# Compile AWS credential helper
FROM golang:1.8.3 as aws_ecr_credential_helper
WORKDIR /go/src/github.com/awslabs/
RUN git clone https://github.com/awslabs/amazon-ecr-credential-helper.git
WORKDIR /go/src/github.com/awslabs/amazon-ecr-credential-helper
RUN make

FROM puckel/docker-airflow:1.8.1
MAINTAINER wongwill86

ARG AIRFLOW_HOME=/usr/local/airflow
ENV AIRFLOW_HOME ${AIRFLOW_HOME}
ENV AIRFLOW_USER airflow

USER root
RUN curl -fsSL https://get.docker.com/ | sh
RUN pip install docker-py
RUN apt-get install sudo

RUN apt-get clean \
    && rm -rf \
        /var/lib/apt/lists/* \
        /tmp/* \
        /var/tmp/* \
        /usr/share/man \
        /usr/share/doc \
        /usr/share/doc-base

RUN usermod -aG docker airflow

# unfortunately this is required to update the container docker gid to match the
# host's gid, we remove this permission from entrypoint-dood.sh script
RUN echo "airflow ALL=NOPASSWD: ALL" >> /etc/sudoers
WORKDIR ${AIRFLOW_HOME}/.docker

# this is to enable aws ecr credentials helpers to reauthorize docker
RUN echo '{\n    "credsStore": "ecr-login"\n}' > config.json
# copy the built docker credentials module to this container
COPY --from=aws_ecr_credential_helper \
    /go/src/github.com/awslabs/amazon-ecr-credential-helper/bin/local/docker-credential-ecr-login \
    /usr/local/bin

COPY deploy/scripts/entrypoint-dood.sh /entrypoint-dood.sh
COPY deploy/config/airflow.cfg ${AIRFLOW_HOME}/airflow.cfg

RUN chown -R airflow: ${AIRFLOW_HOME}

USER airflow
WORKDIR ${AIRFLOW_HOME}
{'fraction_non_alphanumeric': 0.11227672242699178, 'fraction_numerical': 0.008789339381910972, 'mean_word_length': 3.5115089514066495, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '553842', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1250, 'n_words': 328}