puckel / docker-airflow

Docker Apache Airflow
Apache License 2.0
3.77k stars 537 forks source link

Cannot install additional packages #586

Open IanAtDazed opened 4 years ago

IanAtDazed commented 4 years ago

I have tried to install additional packages (Linux utilities and Python packages), but whenever I run the container I find they are not installed. I am very new to Docker (and the docker-airflow image), so I don’t know whether I am hitting an issue or simply doing things the wrong way.

Steps to reproduce attempting to install the linux package: poppler-utils, and the Python package: pdfminer.six

Amend Dockerfile as follows:

RUN set -ex \
    && buildDeps=' \
        ...
    ' \
    && apt-get update -yqq \
    && apt-get upgrade -yqq \
    && apt-get install -yqq --no-install-recommends \
        ...
        locales \
        poppler-utils \
    && sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen \
    ...
    && pip install pdfminer.six \
    ...

Run: docker-compose -f ./docker-compose-LocalExecutor.yml up

docker exec -it beecc066387f bash

apt list --installed (poppler-utils is not listed)

pip list (pdfminer.six is not listed)

Please can you advise how I can resolve this, as I am desperate to get this up and running as soon as possible.

Thank you! I

nbuzzano commented 4 years ago

Hi, I'm doing the following and its working for me:

On the docker-compose.yml that you're running ( in your case docker-compose-LocalExecutor ) add the following key

... webserver: ... build: ... args: PYTHON_DEPS: scipy pandas #or the libraries that you need

Then you just need to rebuild the image, this is: 🚫 instead of doing 'docker-compose up' ✅ do the following 'docker-compose build' and once this command is finished, you can do 'docker-compose up'

TheWindRider commented 2 years ago

Where are these docker compose yml files?