I am new to docker.
I have two questions
Question # 1
I've created this basic docker file that installs the Apache-Airflow and Apache-Celery. But for now, just wanted to install airflow. I am facing a strange issue saying unsatisfiable constraints
.
I'm getting tired. I've tried but not able to resolve the issue. Any help will be appreciated a lot.
FROM python:3.6-alpine
WORKDIR /airflow
RUN apk add git gcc python3-dev gpgme-dev libc-dev python-devel python-setuptools mysql-devel gcc-c++
COPY airflow/requirements.txt airflow/requirements.txt
RUN pip install -r airflow/requirements.txt
COPY . /airflow
EXPOSE 8080 5555
CMD ["airflow", "initdb"]
I've my requirements.txt file which has the dependencies for Apache-Airflow.
requirements.txt
pytz==2015.7
cryptography
requests
pyOpenSSL
ndg-httpsclient
pyasn1
psycopg2
celery>=4.0.0
flower>=0.7.3
Flask==1.1.1
requests==2.22.0
airflow==1.10.8
MySQL-python
flask_bcrypt
Question # 2
We use conda-library
image continuumio/miniconda3
to install the dependencies. Is it a good approach to use???
Made a few changes, here's the new dockerfile:
FROM python:3.6-alpine
WORKDIR /airflow
RUN apk add build-base libffi-dev musl-dev postgresql-dev mariadb-connector-c-dev
COPY requirements.txt ./requirements.txt
RUN pip install -r requirements.txt
COPY . /airflow
EXPOSE 8080 5555
CMD ["airflow", "initdb"]
And the new requirements.txt:
pytz==2015.7
cryptography
pyOpenSSL
ndg-httpsclient
pyasn1
psycopg2
celery>=4.0.0
flower>=0.7.3
Flask==1.1.1
requests==2.22.0
apache-airflow==1.10.8
mysqlclient
flask_bcrypt
Summary of changes:
apk add build-base
libffi-dev
for the cryptography
packagemusl-dev
and postgresql-dev
for psycopg2mysqlclient
mariadb-connect-c-dev
for mysqlclient
And yes, generally you might be better off not using alpine to build python packages (https://pythonspeed.com/articles/alpine-docker-python/) . If you switch to continuumio/miniconda3
it is a little simpler (and much faster to build).
FROM continuumio/miniconda3
WORKDIR /airflow
RUN apt-get update && apt-get install -y libpq-dev libmariadbclient-dev build-essential
COPY requirements.txt ./requirements.txt
RUN pip install -r requirements.txt
COPY . /airflow
EXPOSE 8080 5555
CMD ["airflow", "initdb"]