Modified so that differences in Docker image are not output as much as possible even if the source code is changed.
@@ -90,19 +90,16 @@ RUN pip install -U pip setuptools
RUN apt-get update && apt-get install -y g++-5-arm-linux-gnueabihf && \
ln -s /usr/bin/arm-linux-gnueabihf-g++-5 /usr/bin/arm-linux-gnueabihf-g++
-# Copy lmnet sources to docker image
-COPY lmnet /home/blueoil/lmnet
-WORKDIR /home/blueoil/lmnet
-
# Install requirements
-RUN pip install -r gpu.requirements.txt
+COPY lmnet/*requirements.txt /tmp/requirements/
+RUN pip install -r /tmp/requirements/gpu.requirements.txt && rm -rf /tmp/requirements
# In order to install blueoil requirements `prompt_toolkit==1.0.15`, uninstall prompt-toolkit v2.0 that depends on `pdb==0.10.2`.
RUN pip uninstall -y prompt-toolkit
# Build coco. It needs numpy.
-COPY lmnet/third_party third_party
+COPY lmnet/third_party /home/blueoil/lmnet/third_party
# https://github.com/cocodataset/cocoapi/blob/440d145a30b410a2a6032827c568cff5dc1d2abf/PythonAPI/setup.py#L2
-RUN cd third_party/coco/PythonAPI && pip install -e .
+RUN cd /home/blueoil/lmnet/third_party/coco/PythonAPI && pip install -e .
# For development
RUN apt-get update && apt-get install -y \
@@ -112,24 +109,24 @@ RUN apt-get update && apt-get install -y \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
-# Copy dlk sources to docker image
-COPY dlk /home/blueoil/dlk
-# Install dlk
-WORKDIR /home/blueoil/dlk
-RUN PYTHONPATH=python/dlk python setup.py install
-
# Copy blueoil sources to docker image
COPY blueoil /home/blueoil/blueoil
-COPY setup.py /home/blueoil/setup.py
-COPY setup.cfg /home/blueoil/setup.cfg
+COPY setup.* /home/blueoil/
+COPY output_template /home/blueoil/output_template
# Install blueoil
WORKDIR /home/blueoil
RUN python setup.py install
-# Enable to be written by all user
RUN chmod 777 /home/blueoil
+
+# Copy dlk sources to docker image
+COPY dlk /home/blueoil/dlk
+# Install dlk
+WORKDIR /home/blueoil/dlk
+RUN PYTHONPATH=python/dlk python setup.py install
RUN chmod 777 /home/blueoil/dlk
-# Copy output template
-COPY output_template /home/blueoil/output_template
+# Copy lmnet sources to docker image
+COPY lmnet /home/blueoil/lmnet
ENV PYTHONPATH $PYTHONPATH:/home/blueoil:/home/blueoil/lmnet:/home/blueoil/dlk/python/dlk
+WORKDIR /home/blueoil
