-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.dev
More file actions
79 lines (69 loc) · 3.58 KB
/
Dockerfile.dev
File metadata and controls
79 lines (69 loc) · 3.58 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM debian:bookworm-slim
# Strict shell for every RUN: -e fails fast, -o pipefail propagates errors
# through `curl | bash`-style pipelines so a partial download cannot silently
# produce a "successful" build.
SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Override any inherited ENTRYPOINT/CMD so `docker run image <command> ...`
# behaves predictably regardless of how the base evolves.
ENTRYPOINT []
CMD ["/bin/bash"]
# ── System packages (must run as root — apt-get requires it) ──────────────────
# build-essential : C compiler + linker required by Rust crates that call `cc`
# (portable-pty, ring, etc.). Also brings in `make`.
# pkg-config : lets Rust build scripts locate system libraries.
# libxcb*-dev : X11 clipboard backend compiled into the `arboard` crate.
# libwayland-dev : Wayland clipboard backend compiled into the `arboard` crate.
# musl-tools : musl-gcc cross-compiler; required to build the
# x86_64-unknown-linux-musl target for the statically-linked
# release binary (aspec/architecture/design.md).
RUN rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
libwayland-dev \
libxcb1-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
musl-tools \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# ── GitHub CLI (must run as root — writes to /etc/apt) ────────────────────────
# scripts/release.sh calls `gh auth status`, `gh release create`, etc.
# Pin the official GitHub apt repository so the version is controlled.
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
-o /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
> /etc/apt/sources.list.d/github-cli.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends gh \
&& rm -rf /var/lib/apt/lists/*
# ── Create the amux user (idempotent in case base evolves) ────────────────────
RUN { id -u amux >/dev/null 2>&1 \
|| useradd -m -s /bin/bash -d /home/amux amux 2>/dev/null \
|| useradd -s /bin/bash -d /home/amux amux ; } \
&& mkdir -p /home/amux \
&& chown -R amux:amux /home/amux
# ── Rust toolchain (installed as root, then ownership transferred to amux) ────
# Pin to the MSRV declared in Cargo.toml (rust-version = "1.94.0").
# RUSTUP_HOME and CARGO_HOME are placed under /usr/local so the installation
# is shared across all users without needing per-user ~/.cargo in PATH.
# The x86_64-unknown-linux-musl target is added for the statically-linked
# release binary required by aspec/architecture/design.md.
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
RUST_VERSION=1.94.0 \
PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN curl -sSf https://sh.rustup.rs \
| sh -s -- --no-modify-path --default-toolchain ${RUST_VERSION} -y \
&& rustup target add x86_64-unknown-linux-musl \
&& chown -R amux:amux $RUSTUP_HOME $CARGO_HOME
USER amux
ENV HOME=/home/amux
WORKDIR /workspace