Update Airflow Dockerfile to unpack python3.10 versions of osm_common and osm_ngsa 57/13357/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 10 May 2023 15:02:39 +0000 (17:02 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 10 May 2023 15:02:39 +0000 (17:02 +0200)
Change-Id: I2a650b66cfdf8bb2249882947d0a47622c673806
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
docker/Airflow/Dockerfile

index 97f2dd6..1a4184c 100644 (file)
@@ -20,7 +20,7 @@ USER root
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
     gcc git python3 python3-dev python3-venv python3-pip \
-    python3-setuptools wget && \
+    python3-setuptools wget zstd && \
     python3 -m pip install -U pip build
 
 USER airflow
@@ -29,14 +29,25 @@ ARG PYTHON3_OSM_COMMON_URL
 ARG PYTHON3_OSM_NGSA_URL
 RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
 RUN curl $PYTHON3_OSM_NGSA_URL -o 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 ar x osm_common.deb && \
+    zstd -d < control.tar.zst | xz > control.tar.xz && \
+    zstd -d < data.tar.zst | xz > data.tar.xz && \
+    ar -m -c -a sdsd osm_common_repacked.deb debian-binary control.tar.xz data.tar.xz && \
+    rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst
+RUN ar x osm_ngsa.deb && \
+   zstd -d < control.tar.zst | xz > control.tar.xz && \
+   zstd -d < data.tar.zst | xz > data.tar.xz && \
+   ar -m -c -a sdsd osm_ngsa_repacked.deb debian-binary control.tar.xz data.tar.xz && \
+   rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst
+
+RUN mkdir /tmp/osm
+RUN dpkg-deb -x osm_common_repacked.deb /tmp/osm
+RUN dpkg-deb -x osm_ngsa_repacked.deb /tmp/osm
 RUN mv /tmp/osm/usr/lib/python3/dist-packages/* /home/airflow/.local/lib/python3.10/site-packages/
 RUN rm -rf /tmp/osm
 
 RUN pip3 install \
-    -r /home/airflow/.local/lib/python3.10/site-packages/osm_common/requirements.txt \
-    -r /home/airflow/.local/lib/python3.10/site-packages/osm_ngsa/requirements.txt
+   -r /home/airflow/.local/lib/python3.10/site-packages/osm_common/requirements.txt \
+   -r /home/airflow/.local/lib/python3.10/site-packages/osm_ngsa/requirements.txt