-RUN apt-get install -y python3-osm-im${IM_VERSION} python3-osmclient${OSMCLIENT_VERSION}
-RUN apt-get install -y osm-tests${TESTS_VERSION} && \
- rm -rf /var/lib/apt/lists/*
+ARG OSM_TESTS_URL
+ARG PYTHON3_OSM_IM_URL
+ARG PYTHON3_OSMCLIENT_URL
+
+RUN curl $PYTHON3_OSM_IM_URL -o osm_im.deb
+RUN dpkg -i ./osm_im.deb
+
+RUN curl $PYTHON3_OSMCLIENT_URL -o osmclient.deb
+RUN dpkg -i ./osmclient.deb
+
+RUN curl $OSM_TESTS_URL -o osm_tests.deb
+RUN dpkg -i ./osm_tests.deb
+
+RUN pip3 install \
+ -r /usr/lib/python3/dist-packages/osm_im/requirements.txt \
+ -r /usr/lib/python3/dist-packages/osmclient/requirements.txt \
+ -r /usr/share/osm-tests/requirements.txt