python3-setuptools wget && \
python3 -m pip install -U pip build
+USER airflow
+
ARG PYTHON3_OSM_COMMON_URL
ARG PYTHON3_OSM_NGSA_URL
RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
-RUN dpkg -i ./osm_common.deb
RUN curl $PYTHON3_OSM_NGSA_URL -o osm_ngsa.deb
-RUN dpkg -i ./osm_ngsa.deb
+RUN mkdir /tmp/osm
+RUN dpkg-deb -x osm_common.deb /tmp/osm
+RUN dpkg-deb -x osm_ngsa.deb /tmp/osm
+
+RUN mv /tmp/osm/usr/lib/python3/dist-packages/* /home/airflow/.local/lib/python3.8/site-packages/
+RUN rm -rf /tmp/osm
RUN pip3 install \
- -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
- -r /usr/lib/python3/dist-packages/osm_ngsa/requirements.txt
+ -r /home/airflow/.local/lib/python3.8/site-packages/osm_common/requirements.txt \
+ -r /home/airflow/.local/lib/python3.8/site-packages/osm_ngsa/requirements.txt
+
+RUN pip3 install \
+ -r /home/airflow/.local/lib/python3.8/site-packages/osm_common/requirements.txt \
+ -r /home/airflow/.local/lib/python3.8/site-packages/osm_ngsa/requirements.txt
-USER airflow