Skip to content

Commit c55ebfb

Browse files
committed
OCI: Improve image by bundling all build commands
Also, remove build artefacts.
1 parent 692b504 commit c55ebfb

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

Dockerfile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
FROM python:3.13-slim-bookworm
22

3+
# Configure operating system
34
ENV DEBIAN_FRONTEND=noninteractive
45
ENV TERM=linux
56

6-
# Install prerequisites
7-
RUN apt-get update
8-
RUN apt-get --yes install jq
9-
10-
# Provide sources
7+
# Provide package sources
118
COPY . /src
129

13-
# Install package
10+
# Install package and dependencies
11+
ENV UV_COMPILE_BYTECODE=true
12+
ENV UV_NO_CACHE=true
13+
ENV UV_PYTHON_DOWNLOADS=never
1414
ENV UV_SYSTEM_PYTHON=true
1515
RUN \
1616
true \
17+
# Install package.
1718
&& pip install uv \
1819
&& uv pip install /src \
19-
&& uv pip uninstall uv
20+
&& uv pip uninstall uv \
21+
# Install `jq`.
22+
&& apt-get update \
23+
&& apt-get install --no-install-recommends --no-install-suggests --yes jq \
24+
# Tear down.
25+
&& apt-get autoremove --yes \
26+
&& apt-get autoclean --yes \
27+
&& rm -rf /var/lib/apt/lists/* \
28+
&& rm -rf /root/.cache \
29+
&& rm -rf /src \
30+
&& rm -rf /tmp/*

0 commit comments

Comments
 (0)