Skip to content

Commit

Permalink
Use rdfind to make the docker image slightly smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Aug 21, 2024
1 parent f5fadd9 commit c7263a4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ RUN apt-get update && \
build-essential \
# can speed up large_image caching \
memcached \
# used to reduce docker image size \
rdfind \
&& \
# Clean up to reduce docker size \
apt-get autoremove && \
Expand Down Expand Up @@ -51,7 +53,9 @@ RUN pip install --no-cache-dir --upgrade pip setuptools && \
# install step \
pip install --no-cache-dir nimfa numpy scipy Pillow pandas scikit-image scikit-learn imageio 'shapely[vectorized]' opencv-python-headless sqlalchemy matplotlib 'dask[dataframe]' distributed && \
# clean up \
rm -rf /root/.cache/pip/*
rm -rf /root/.cache/pip/* && \
# Make duplicate files not take extra space in the docker image \
rdfind -minsize 32768 -makehardlinks true -makeresultsfile false /usr/local

# Install the latest version of large_image. This can be disabled if the
# latest version we need has had an official release
Expand All @@ -68,7 +72,9 @@ WORKDIR $htk_path
# Install HistomicsTK and its dependencies
RUN pip install --no-cache-dir . --find-links https://girder.github.io/large_image_wheels && \
pip install --no-cache-dir virtualenv && \
rm -rf /root/.cache/pip/*
rm -rf /root/.cache/pip/* && \
# Make duplicate files not take extra space in the docker image \
rdfind -minsize 32768 -makehardlinks true -makeresultsfile false /usr/local

# Show what was installed
RUN pip freeze
Expand Down

0 comments on commit c7263a4

Please sign in to comment.