Fixed build error on Dockerfile witht the LOCAL_PROTOS or LOCAL_PYVOLTHA flags, while keeping it passing with docker lint
Change-Id: Ia2ef797598c308b58a640e85edc17f47150e30af
diff --git a/python/docker/Dockerfile.adapter_ponsim_olt b/python/docker/Dockerfile.adapter_ponsim_olt
index de1851f..75f135c 100644
--- a/python/docker/Dockerfile.adapter_ponsim_olt
+++ b/python/docker/Dockerfile.adapter_ponsim_olt
@@ -42,11 +42,15 @@
ARG LOCAL_PROTOS
COPY local_imports/ /local_imports/
RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \
- pip install /local_imports/pyvoltha/dist/*.tar.gz==* ; \
+ PYVOLTHA_PATH=$(ls /local_imports/pyvoltha/dist/) ; \
+ printf "/local_imports/pyvoltha/dist/%s\npyvoltha" "$PYVOLTHA_PATH" > pyvoltha-install.txt ; \
+ pip install -r pyvoltha-install.txt ; \
fi
RUN if [ -n "$LOCAL_PROTOS" ] ; then \
- pip install /local_imports/voltha-protos/dist/*.tar.gz==* ; \
+ PROTOS_PATH=$(ls /local_imports/voltha-protos/dist/) ; \
+ printf "/local_imports/voltha-protos/dist/%s\nvoltha-protos" "$PROTOS_PATH" > protos-install.txt ; \
+ pip install -r protos-install.txt ; \
fi
# Bundle app source
diff --git a/python/docker/Dockerfile.adapter_ponsim_onu b/python/docker/Dockerfile.adapter_ponsim_onu
index 21cd0e6..58689cc 100644
--- a/python/docker/Dockerfile.adapter_ponsim_onu
+++ b/python/docker/Dockerfile.adapter_ponsim_onu
@@ -42,12 +42,16 @@
ARG LOCAL_PROTOS
COPY local_imports/ /local_imports/
RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \
- pip install /local_imports/pyvoltha/dist/*.tar.gz==* ; \
+ PYVOLTHA_PATH=$(ls /local_imports/pyvoltha/dist/) ; \
+ printf "/local_imports/pyvoltha/dist/%s\npyvoltha" "$PYVOLTHA_PATH" > pyvoltha-install.txt ; \
+ pip install -r pyvoltha-install.txt ; \
fi
RUN if [ -n "$LOCAL_PROTOS" ] ; then \
- pip install /local_imports/voltha-protos/dist/*.tar.gz==* ; \
-fi
+ PROTOS_PATH=$(ls /local_imports/voltha-protos/dist/) ; \
+ printf "/local_imports/voltha-protos/dist/%s\nvoltha-protos" "$PROTOS_PATH" > protos-install.txt ; \
+ pip install -r protos-install.txt ; \
+ fi
# Bundle app source
RUN mkdir /voltha && touch /voltha/__init__.py
diff --git a/python/docker/Dockerfile.cli b/python/docker/Dockerfile.cli
index 11a3a81..eec4185 100644
--- a/python/docker/Dockerfile.cli
+++ b/python/docker/Dockerfile.cli
@@ -43,13 +43,16 @@
ARG LOCAL_PROTOS
COPY local_imports/ /local_imports/
RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \
- pip install /local_imports/pyvoltha/dist/*.tar.gz==* ; \
+ PYVOLTHA_PATH=$(ls /local_imports/pyvoltha/dist/) ; \
+ printf "/local_imports/pyvoltha/dist/%s\npyvoltha" "$PYVOLTHA_PATH" > pyvoltha-install.txt ; \
+ pip install -r pyvoltha-install.txt ; \
fi
RUN if [ -n "$LOCAL_PROTOS" ] ; then \
- pip install /local_imports/voltha-protos/dist/*.tar.gz==* ; \
-fi
-
+ PROTOS_PATH=$(ls /local_imports/voltha-protos/dist/) ; \
+ printf "/local_imports/voltha-protos/dist/%s\nvoltha-protos" "$PROTOS_PATH" > protos-install.txt ; \
+ pip install -r protos-install.txt ; \
+ fi
# Bundle app source
RUN mkdir /voltha && touch /voltha/__init__.py
ENV PYTHONPATH=/voltha
diff --git a/python/docker/Dockerfile.ofagent b/python/docker/Dockerfile.ofagent
index d5717ff..52ebaaa 100644
--- a/python/docker/Dockerfile.ofagent
+++ b/python/docker/Dockerfile.ofagent
@@ -42,12 +42,16 @@
ARG LOCAL_PROTOS
COPY local_imports/ /local_imports/
RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \
- pip install /local_imports/pyvoltha/dist/*.tar.gz==* ; \
+ PYVOLTHA_PATH=$(ls /local_imports/pyvoltha/dist/) ; \
+ printf "/local_imports/pyvoltha/dist/%s\npyvoltha" "$PYVOLTHA_PATH" > pyvoltha-install.txt ; \
+ pip install -r pyvoltha-install.txt ; \
fi
RUN if [ -n "$LOCAL_PROTOS" ] ; then \
- pip install /local_imports/voltha-protos/dist/*.tar.gz==* ; \
-fi
+ PROTOS_PATH=$(ls /local_imports/voltha-protos/dist/) ; \
+ printf "/local_imports/voltha-protos/dist/%s\nvoltha-protos" "$PROTOS_PATH" > protos-install.txt ; \
+ pip install -r protos-install.txt ; \
+ fi
# Bundle app source
RUN mkdir /ofagent && \