-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathContainerfile
More file actions
57 lines (52 loc) · 2.59 KB
/
Copy pathContainerfile
File metadata and controls
57 lines (52 loc) · 2.59 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM --platform=$BUILDPLATFORM ghcr.io/astral-sh/uv:0.11.29@sha256:eb2843a1e56fd9e30c7276ce1a52cba86e64c7b385f5e3279a0e08e02dd058fc AS uv-bin
FROM --platform=$BUILDPLATFORM registry.fedoraproject.org/fedora:44 AS builder
COPY --from=uv-bin /uv /uvx /bin/
RUN dnf install -y make git && \
dnf clean all && \
rm -rf /var/cache/dnf
FROM registry.fedoraproject.org/fedora:44 AS product
COPY --from=ghcr.io/astral-sh/uv:0.11.29@sha256:eb2843a1e56fd9e30c7276ce1a52cba86e64c7b385f5e3279a0e08e02dd058fc /uv /uvx /bin/
RUN dnf install -y python3 ustreamer libusb1 android-tools python3-libgpiod curl \
nftables dnsmasq iproute procps-ng tcpdump && \
dnf clean all && \
rm -rf /var/cache/dnf
# renovate: datasource=github-releases depName=jumpstarter-dev/fls
ARG FLS_VERSION=0.3.0
RUN ARCH=$(uname -m) && \
SUFFIX="linux" && \
if [ "$ARCH" = "aarch64" ]; then SUFFIX="linux-musl"; fi && \
URL="https://github.com/jumpstarter-dev/fls/releases/download/${FLS_VERSION}/fls-${ARCH}-${SUFFIX}" && \
TEMP_FILE="/tmp/fls-${ARCH}-${SUFFIX}.tmp" && \
curl -fsSL "${URL}" -o "${TEMP_FILE}" && \
mv "${TEMP_FILE}" /usr/local/bin/fls && \
chmod +x /usr/local/bin/fls && \
if [ "$ARCH" != "aarch64" ]; then \
curl -fsSL "https://github.com/jumpstarter-dev/fls/releases/download/${FLS_VERSION}/fls-aarch64-linux-musl" \
-o /usr/local/bin/fls-aarch64 && \
chmod +x /usr/local/bin/fls-aarch64; \
else \
ln -s /usr/local/bin/fls /usr/local/bin/fls-aarch64; \
fi
# Build the jumpstarter-exec Rust binary for the sidecar remote-exec bridge.
# Uses UBI 10 + rust-toolset for Red Hat-supported toolchain and glibc compatibility.
FROM registry.access.redhat.com/ubi10/ubi:latest@sha256:145a2d6e7e224d34fbe601832e3f133c11560e15b4074fad75c449387bb105a0 AS rust-builder
# GIT_VERSION is already passed as a build-arg by CI (see build-images.yaml)
# for hatch-vcs; forward it into the Rust build so jumpstarter-exec's
# build.rs can embed the same version (see rust/jumpstarter-exec/build.rs).
ARG GIT_VERSION=0.0.0-dev
ENV GIT_VERSION=${GIT_VERSION}
RUN dnf install -y rust-toolset && \
dnf clean all && \
rm -rf /var/cache/dnf
COPY rust/ /src/rust/
WORKDIR /src/rust
RUN cargo build --release -p jumpstarter-exec
FROM builder AS wheels
ADD . /src
RUN make -C /src/python build
FROM product
RUN --mount=from=wheels,source=/src/python/dist,target=/dist \
uv venv /jumpstarter && \
VIRTUAL_ENV=/jumpstarter uv pip install /dist/*.whl
COPY --from=rust-builder /src/rust/target/release/jumpstarter-exec /jumpstarter/bin/jumpstarter-exec
ENV PATH="/jumpstarter/bin:$PATH"