Skip to content

Commit

Permalink
Docker update: Minor fixes
Browse files Browse the repository at this point in the history
- Add two steps for python pip install, installing wheel ahead.
This reduces the build time, not forcing to use old setup.py method
- Lock cache for apt to avoid clash on parallel updates

Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
Helio Chissini de Castro committed Dec 9, 2021
1 parent 5ef25be commit 319991d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN /etc/scripts/import_proxy_certs.sh \

#------------------------------------------------------------------------
# Ubuntu build toolchain
RUN --mount=type=cache,target=/var/cache/apt apt-get update \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
clang-9 \
Expand Down Expand Up @@ -115,12 +115,13 @@ RUN CC=clang-9 CXX=clang++9 pyenv install "${PYTHON_VERSION}"
RUN pyenv global "${PYTHON_VERSION}"
ENV PATH=/opt/python/shims:$PATH
RUN pip install -U \
conan=="${CONAN_VERSION}" \
pip=="${PIPTOOL_VERSION}" \
wheel
RUN pip install -U \
conan=="${CONAN_VERSION}" \
pipenv \
Mercurial \
virtualenv=="${PYTHON_VIRTUALENV_VERSION}" \
wheel
virtualenv=="${PYTHON_VIRTUALENV_VERSION}"

COPY docker/python.sh /etc/profile.d

Expand Down Expand Up @@ -262,7 +263,7 @@ RUN ln -s /opt/scancode/bin/scancode /usr/bin/scancode \
&& ln -s /opt/scancode/bin/pip /usr/bin/scancode-pip \
&& ln -s /opt/scancode/bin/extractcode /usr/bin/extractcode

RUN --mount=type=cache,target=/var/cache/apt apt-get update \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
cvs \
Expand Down Expand Up @@ -290,7 +291,7 @@ RUN curl -ksS "$KEYURL" | gpg --dearmor | tee "/etc/apt/trusted.gpg.d/git-core_u
ARG COMPOSER_VERSION=1.10.1-1

# Apt install commands.
RUN --mount=type=cache,target=/var/cache/apt apt-get update \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
cargo \
composer=$COMPOSER_VERSION \
Expand Down

0 comments on commit 319991d

Please sign in to comment.