forked from AsherBond/truss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext_builder.Dockerfile
More file actions
40 lines (31 loc) · 1.32 KB
/
Copy pathcontext_builder.Dockerfile
File metadata and controls
40 lines (31 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Builds baseten/truss-context-builder, a light-weight image that can be used
# for creating docker build context out of a Truss.
# Build that image as:
# docker buildx build . -f context_builder.Dockerfile --platform=linux/amd64 -t baseten/truss-context-builder
FROM python:3.9-slim AS builder
RUN apt-get update \
&& apt-get install --yes --no-install-recommends curl \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /tmp/library-scripts/
RUN curl -sSLf --retry 5 --retry-delay 5 https://astral.sh/uv/0.7.12/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"
# Chains/train source code is not actually needed (and deps from chains group won't be
# installed when using `--only builder`). But nonetheless `uv` fails the install
# if this directory is not present/empty - so we copy it.
WORKDIR /app
COPY ./truss ./truss
COPY ./truss-chains ./truss-chains
COPY ./truss-train ./truss-train
COPY ./pyproject.toml ./pyproject.toml
COPY ./uv.lock ./uv.lock
COPY ./README.md ./README.md
RUN uv sync
FROM python:3.9-slim
WORKDIR /app
COPY --from=builder /app /app
# Copy `uv` and required files
COPY --from=builder /root/.local /root/.local
ENV PATH="/root/.local/bin:${PATH}"
ENV ENGINE_BUILDER_TRUSS_RUNTIME_MIGRATION="True"
RUN apt-get update && apt-get install --yes --no-install-recommends curl tar