1
1
# Build in a full featured container
2
2
ARG TARGETARCH
3
+ ARG UV_IMAGE=ghcr.io/astral-sh/uv:latest
4
+ FROM --platform=linux/$TARGETARCH ${UV_IMAGE} AS uv
3
5
FROM --platform=linux/$TARGETARCH python:3.11-bullseye AS build
4
6
5
7
# Install protobuf compiler
6
8
RUN apt-get update \
7
- && DEBIAN_FRONTEND=noninteractive \
9
+ && DEBIAN_FRONTEND=noninteractive \
8
10
apt-get install --no-install-recommends --assume-yes \
9
- protobuf-compiler=3.12.4-1+deb11u1 libprotobuf-dev=3.12.4-1+deb11u1
11
+ protobuf-compiler=3.12.4-1+deb11u1 libprotobuf-dev=3.12.4-1+deb11u1
10
12
11
13
# Get go compiler
12
14
ARG TARGETARCH
@@ -20,7 +22,7 @@ RUN wget -q -O - https://sh.rustup.rs | sh -s -- -y
20
22
ENV PATH="$PATH:/root/.cargo/bin"
21
23
22
24
# Install uv
23
- COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
25
+ COPY --from=uv /uv /uvx /bin/
24
26
25
27
WORKDIR /app
26
28
@@ -46,10 +48,14 @@ COPY workers/python ./workers/python
46
48
# Build the worker
47
49
RUN CGO_ENABLED=0 ./temporal-omes prepare-worker --language python --dir-name prepared --version "$SDK_VERSION"
48
50
51
+ # Download the worker dependencies for offline use
52
+ WORKDIR /app/workers/python/prepared
53
+ RUN uv lock && uv sync --frozen
54
+
49
55
# Copy the CLI and built worker to a distroless "run" container
50
56
FROM --platform=linux/$TARGETARCH python:3.11-slim-bullseye
51
57
52
- COPY --from=build /bin/ uv /bin/uv
58
+ COPY --from=uv / uv /uvx / bin/
53
59
COPY --from=build /app/temporal-omes /app/temporal-omes
54
60
COPY --from=build /app/workers/python /app/workers/python
55
61
0 commit comments