-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FYI, clean and autoremove #4
Comments
@sberryman Thank you for pointing this out. You're right, using Your second suggestion is correct as well. But instead of calling I did merge related RUN blocks together, keeping a balance between optimization and readability. I'll keep this issue open for any future suggestions or to correct me if any of my conclusions are wrong. Thanks again for the tips. |
Looking a lot better, here are few more things I noticed:
Example 1: (haven't actually tested this, more pseudo-code) RUN export OPENCV_VERSION=3.4.1 && \
export OPENCV_CHECKSUM=f1b87684d75496a1054405ae3ee0b6573acaf3dad39eaf4f1d66fdd7e03dc852 && \
curl --retry 7 --fail -vo /tmp/opencv.tar.gz "https://codeload.github.com/opencv/opencv/tar.gz/${OPENCV_VERSION}" && \
echo "${OPENCV_CHECKSUM} /tmp/opencv.tar.gz" | sha256sum -c && \
tar -zxf /tmp/opencv.tar.gz -C /usr/local/src/opencv && \
rm /tmp/opencv.tar.gz && \
cd /usr/local/src/opencv && \
mkdir build && && \
cd build && \
cmake -D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D PYTHON_DEFAULT_EXECUTABLE=$(which python3) \
.. && \
make -j"$(nproc)" && \
make install One last note, not doing an |
modern-deep-learning-docker/Dockerfile
Lines 133 to 134 in 36ae632
While it would be great if this reduced the image size, it has zero effect as it is on a different layer. The only way this would be of use is if it is combined with a
RUN
command where you are actually installing or updating the repository.In reality you would need to combine all apt-get update and install commands in a single
RUN
layer where you then clean up at the end of that single command. Considering this is for research and testing it isn't a big deal. Just figured I would point it out.The text was updated successfully, but these errors were encountered: