-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (53 loc) · 2.48 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (53 loc) · 2.48 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
58
# Cross-platform development image for RSScript.
#
# The workspace is edition 2024, which requires Rust >= 1.85; `rust:1-bookworm`
# tracks the latest stable 1.x and always satisfies that. Pin to a concrete tag
# (e.g. `rust:1.88-bookworm`) if you want a fully reproducible toolchain.
#
# The source tree is NOT copied into the image — it is bind-mounted at runtime
# (see compose.yaml) so edits on the host are seen instantly on every platform.
# This image only provides the toolchain and system libraries.
FROM rust:1-bookworm
# System libraries needed to build the workspace and the Rust packages that
# RSScript lowers to. Everything here uses rustls/ring (no OpenSSL) and a
# source-bundled SQLite, so the list is just a C/C++ toolchain plus the usual
# fetch/build helpers:
# build-essential, cmake -> `ring` (rustls) and `rusqlite` (bundled SQLite)
# pkg-config -> -sys crate probing
# git, curl, ca-certificates -> fetching crates and tools over HTTPS
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
cmake \
git \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Toolchain components used by the test/lint flow, and cargo-nextest (the test
# runner the `rss test` command and CI use). Prefer the prebuilt nextest binary
# per architecture (works on amd64 and Apple-Silicon/arm64); fall back to a
# source build on other arches.
RUN rustup component add clippy rustfmt \
&& set -eux; \
case "$(uname -m)" in \
x86_64) url="https://get.nexte.st/latest/linux" ;; \
aarch64) url="https://get.nexte.st/latest/linux-arm" ;; \
*) url="" ;; \
esac; \
if [ -n "$url" ]; then \
curl -LsSf "$url" | tar zxf - -C "${CARGO_HOME:-/usr/local/cargo}/bin"; \
else \
cargo install cargo-nextest --locked; \
fi
# The base image puts the toolchain on PATH via the container environment, but a
# login shell (`bash -l`, some devcontainer setups) re-derives PATH from
# /etc/profile and would drop it. Add a profile snippet so cargo/rustc/nextest
# are on PATH for every shell flavor.
RUN printf 'export PATH="%s/bin:$PATH"\n' "${CARGO_HOME:-/usr/local/cargo}" \
> /etc/profile.d/rust-cargo.sh
WORKDIR /work
# `rss` (and the test suite) compiles generated Rust packages at runtime, so the
# container keeps the full toolchain available. Default to an interactive shell;
# compose overrides the command for one-off runs.
CMD ["bash"]