|
1 | 1 | # DevContainer image |
2 | | -FROM rust:1.87-slim |
| 2 | +FROM ubuntu:24.04 |
3 | 3 | RUN \ |
4 | | - adduser --system --disabled-password --shell /bin/bash --home /home/vscode vscode && \ |
5 | 4 | # install docker |
6 | 5 | apt-get update && \ |
7 | | - apt-get install ca-certificates curl gnupg lsb-release -y && \ |
| 6 | + apt-get install ca-certificates curl -y && \ |
8 | 7 | mkdir -m 0755 -p /etc/apt/keyrings && \ |
9 | | - curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ |
10 | | - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ |
| 8 | + curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \ |
| 9 | + chmod a+r /etc/apt/keyrings/docker.asc && \ |
| 10 | + echo \ |
| 11 | + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
| 12 | + $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ |
| 13 | + tee /etc/apt/sources.list.d/docker.list > /dev/null && \ |
11 | 14 | apt-get update && \ |
12 | 15 | apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y && \ |
13 | | - usermod -aG docker vscode && \ |
| 16 | + usermod -aG docker ubuntu && \ |
14 | 17 | apt-get clean |
15 | 18 | RUN \ |
16 | 19 | # dev setup |
17 | 20 | apt update && \ |
18 | | - apt-get install sudo jq git bash-completion graphviz rsync -y && \ |
19 | | - usermod -aG sudo vscode && \ |
| 21 | + apt-get install sudo jq bash-completion graphviz rsync software-properties-common gcc -y && \ |
| 22 | + add-apt-repository ppa:git-core/ppa && \ |
| 23 | + apt update && \ |
| 24 | + apt-get install git -y && \ |
| 25 | + usermod -aG sudo ubuntu && \ |
20 | 26 | echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ |
21 | | - echo '. /etc/bash_completion' >> /home/vscode/.bashrc && \ |
22 | | - echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\[\e[33;1m\]\w\[\e[m\]$ "' >> /home/vscode/.bashrc && \ |
23 | | - chown vscode:nogroup /home/vscode/.bashrc && \ |
| 27 | + echo '. /etc/bash_completion' >> /home/ubuntu/.bashrc && \ |
| 28 | + echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\[\e[33;1m\]\w\[\e[m\]$ "' >> /home/ubuntu/.bashrc && \ |
| 29 | + chown ubuntu:nogroup /home/ubuntu/.bashrc && \ |
24 | 30 | apt-get clean |
25 | 31 |
|
26 | | -USER vscode |
27 | | -ENV CARGO_HOME=/home/vscode/.cargo \ |
28 | | - PATH=/home/vscode/.cargo/bin:/home/vscode/.local/bin:$PATH |
| 32 | +USER ubuntu |
| 33 | +ENV CARGO_HOME=/home/ubuntu/.cargo \ |
| 34 | + PATH=/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:$PATH |
29 | 35 | RUN \ |
| 36 | + # install rust |
| 37 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.87.0 -y && \ |
30 | 38 | # rust auto formatting |
31 | 39 | rustup component add rustfmt && \ |
32 | 40 | # rust style linter |
|
47 | 55 | # useful in examples |
48 | 56 | uv pip install ipykernel eclipse-zenoh -p ~/.local/share/base && \ |
49 | 57 | echo '. ~/.local/share/base/bin/activate' >> ~/.bashrc |
50 | | -ENV VIRTUAL_ENV=/home/vscode/.local/share/base |
| 58 | +ENV VIRTUAL_ENV=/home/ubuntu/.local/share/base |
51 | 59 | CMD ["bash", "-c", "sudo rm /var/run/docker.pid; sudo dockerd"] |
0 commit comments