-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (50 loc) · 1.74 KB
/
Dockerfile
File metadata and controls
62 lines (50 loc) · 1.74 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
## Dockerfile for devcontainer
FROM mcr.microsoft.com/devcontainers/base:bookworm AS base
ARG USER=vscode
ARG GROUP=vscode
ENV HOME="/home/${USER}"
ENV PATH="$HOME/.cargo/bin:$PATH"
# Install dependencies
RUN apt-get update \
&& apt-get -y install \
build-essential \
cmake \
curl \
gdb \
git \
gnupg \
gnuplot \
lsb-release \
make \
software-properties-common \
sudo \
wget \
musl-tools
ARG LLVM_VERSION=18
# Install llvm
RUN wget https://apt.llvm.org/llvm.sh \
&& chmod +x ./llvm.sh \
&& sudo ./llvm.sh ${LLVM_VERSION} clang clang-tools-extra \
&& sudo ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/ld.lld /usr/bin/ld.lld \
&& sudo ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/clang /usr/bin/clang
FROM base AS dev
# Make sure the devcontainer user has sudo access
RUN chown -R "${USER}:${GROUP}" /home/${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Persist bash hystory
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
&& mkdir /commandhistory \
&& touch /commandhistory/.bash_history \
&& chown -R "${USER}" /commandhistory \
&& echo "$SNIPPET" >> "/home/${USER}/.bashrc"
USER $USER
ARG RUST_TOOLCHAIN=1.89
# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& rustup default ${RUST_TOOLCHAIN} \
&& rustup target add x86_64-unknown-linux-gnu \
&& rustup target add x86_64-unknown-linux-musl \
&& rustup target add x86_64-unknown-none \
&& rustup toolchain add nightly-x86_64-unknown-linux-gnu \
&& cargo install just \
&& cargo install cross --locked --version 0.2.5