Skip to content
Snippets Groups Projects
Unverified Commit d3067a34 authored by Niaz Faridani-Rad's avatar Niaz Faridani-Rad Committed by GitHub
Browse files

Merge pull request #75 from JcMinarro/reduce-docker-layers-size

Reduce docker layer size
parents 69b11e48 44c976d6
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,9 @@ RUN apt-get update \ ...@@ -7,7 +7,9 @@ RUN apt-get update \
&& apt-get install -y python3-pip python3-dev \ && apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \ && cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \ && ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip && pip3 install --upgrade pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# system packages installation # system packages installation
RUN apt-get update && \ RUN apt-get update && \
...@@ -66,7 +68,8 @@ RUN git clone https://github.com/LibRaw/LibRaw && \ ...@@ -66,7 +68,8 @@ RUN git clone https://github.com/LibRaw/LibRaw && \
autoreconf --install && \ autoreconf --install && \
./configure && \ ./configure && \
make && \ make && \
make install make install && \
rm -rf /tmp/builds/*
#Build and install imagemagick #Build and install imagemagick
WORKDIR /tmp/builds WORKDIR /tmp/builds
...@@ -75,7 +78,8 @@ RUN curl -SL https://imagemagick.org/archive/releases/ImageMagick-${IMAGEMAGICK_ ...@@ -75,7 +78,8 @@ RUN curl -SL https://imagemagick.org/archive/releases/ImageMagick-${IMAGEMAGICK_
cd ImageMagick-${IMAGEMAGICK_VERSION} && \ cd ImageMagick-${IMAGEMAGICK_VERSION} && \
./configure --with-modules && \ ./configure --with-modules && \
make install && \ make install && \
ldconfig /usr/local/lib ldconfig /usr/local/lib && \
rm -rf /tmp/builds/*
# Build and install libvips # Build and install libvips
WORKDIR /tmp/builds WORKDIR /tmp/builds
...@@ -85,4 +89,5 @@ RUN curl -SL https://github.com/libvips/libvips/releases/download/v${VIPSVERSION ...@@ -85,4 +89,5 @@ RUN curl -SL https://github.com/libvips/libvips/releases/download/v${VIPSVERSION
&& ./configure \ && ./configure \
&& make V=0 \ && make V=0 \
&& make install \ && make install \
&& ldconfig && ldconfig \
&& rm -rf /tmp/builds/*
...@@ -9,7 +9,8 @@ RUN git clone --depth 1 --branch 'v19.24' https://github.com/davisking/dlib.git ...@@ -9,7 +9,8 @@ RUN git clone --depth 1 --branch 'v19.24' https://github.com/davisking/dlib.git
cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=0 -DLIB_NO_GUI_SUPPORT=0 && \ cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=0 -DLIB_NO_GUI_SUPPORT=0 && \
cmake --build . && \ cmake --build . && \
cd /tmp/builds/dlib && \ cd /tmp/builds/dlib && \
python3 setup.py install --no USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA --no USE_SSE4_INSTRUCTIONS python3 setup.py install --no USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA --no USE_SSE4_INSTRUCTIONS && \
rm -rf /tmp/builds/*
# Download pretrained models # Download pretrained models
WORKDIR /data_models WORKDIR /data_models
...@@ -18,6 +19,3 @@ RUN mkdir -p /root/.cache/torch/hub/checkpoints/ && \ ...@@ -18,6 +19,3 @@ RUN mkdir -p /root/.cache/torch/hub/checkpoints/ && \
curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/im2txt.tar.gz | tar -zxC /data_models/ && \ curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/im2txt.tar.gz | tar -zxC /data_models/ && \
curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/clip-embeddings.tar.gz | tar -zxC /data_models/ && \ curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/clip-embeddings.tar.gz | tar -zxC /data_models/ && \
curl -SL https://download.pytorch.org/models/resnet152-b121ed2d.pth -o /root/.cache/torch/hub/checkpoints/resnet152-b121ed2d.pth curl -SL https://download.pytorch.org/models/resnet152-b121ed2d.pth -o /root/.cache/torch/hub/checkpoints/resnet152-b121ed2d.pth
# Remove build directory
RUN rm -fr /tmp/*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment