mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-21 15:31:00 +00:00
Speed up Docker image build and make image smaller
Run `apt-get upgrade` right after `apt-get install`, instead of cleaning up apt index first, do `apt-get update` again, then `apt-get upgrade`. This will save some build time and disk space, because it didn't clean up apt index after the `apt-get upgrade` before.
This commit is contained in:
parent
9f1417f28c
commit
6c5f27d7f1
2 changed files with 2 additions and 4 deletions
|
@ -5,11 +5,10 @@ WORKDIR /app
|
|||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get -qqq install --no-install-recommends -y pkg-config gcc g++ \
|
||||
&& apt-get upgrade --assume-yes \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt
|
||||
|
||||
RUN apt-get update && apt-get upgrade --assume-yes
|
||||
|
||||
RUN python -mvenv venv && ./venv/bin/pip install --upgrade pip
|
||||
|
||||
COPY . .
|
||||
|
|
|
@ -9,11 +9,10 @@ WORKDIR /app
|
|||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get -qqq install --no-install-recommends -y libicu-dev libaspell-dev libcairo2 libcairo2-dev pkg-config gcc g++ python3.8-dev python3-pip libpython3.8-dev\
|
||||
&& apt-get upgrade --assume-yes \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt
|
||||
|
||||
RUN apt-get update && apt-get upgrade --assume-yes
|
||||
|
||||
RUN pip3 install --upgrade pip && apt-get remove python3-pip --assume-yes
|
||||
|
||||
RUN ln -s /usr/bin/python3 /usr/bin/python
|
||||
|
|
Loading…
Reference in a new issue