Skip to content

Commit

Permalink
chore: Use uv during Dockerfile build (#2485)
Browse files Browse the repository at this point in the history
* Speed up the Dockerfile build by using uv to install all Python
  dependencies.
* Have hadolint ignore SC1091 in Dockerfile.
   - c.f. https://www.shellcheck.net/wiki/SC1091
  • Loading branch information
matthewfeickert authored May 25, 2024
1 parent 42cd129 commit f4eb73f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ FROM base as builder
# Set PATH to pickup virtual environment by default
ENV PATH=/usr/local/venv/bin:"${PATH}"
COPY . /code
# hadolint ignore=DL3003,SC2102
# hadolint ignore=DL3003,SC2102,SC1091
RUN apt-get -qq -y update && \
apt-get -qq -y install --no-install-recommends \
git && \
apt-get -y autoclean && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/* && \
python -m venv /usr/local/venv && \
. /usr/local/venv/bin/activate && \
cd /code && \
python -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python -m pip --no-cache-dir install '.[xmlio,contrib]' && \
python -m pip list
python -m pip --no-cache-dir install --upgrade uv && \
uv pip install --no-cache --upgrade pip setuptools wheel && \
uv pip install --no-cache '.[xmlio,contrib]' && \
uv pip list

FROM base

Expand Down

0 comments on commit f4eb73f

Please sign in to comment.