|
1 | | -FROM mcr.microsoft.com/devcontainers/rust:1-1-bullseye |
| 1 | +FROM mcr.microsoft.com/devcontainers/rust:2-1-bookworm |
2 | 2 |
|
3 | | -RUN sudo apt-get update -y \ |
4 | | - && sudo apt-get upgrade -y |
| 3 | +RUN apt-get update -y \ |
| 4 | + && apt-get upgrade -y \ |
| 5 | + && apt-get install -y --fix-missing --no-install-recommends \ |
| 6 | + zip \ |
| 7 | + qemu-system \ |
| 8 | + binfmt-support \ |
| 9 | + qemu-user-static \ |
| 10 | + nodejs \ |
| 11 | + ruby \ |
| 12 | + php \ |
| 13 | + php-common \ |
| 14 | + python3-pip \ |
| 15 | + gcc-x86-64-linux-gnu \ |
| 16 | + libc6-dev-amd64-cross \ |
| 17 | + && rm -rf /var/lib/apt/lists/* \ |
| 18 | + && update-binfmts --enable qemu-aarch64 |
5 | 19 |
|
6 | | -RUN sudo apt-get install -y --fix-missing zip |
| 20 | +# Easy way to install Python. |
| 21 | +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 |
7 | 22 |
|
8 | | -RUN sudo apt-get update -y \ |
9 | | - && sudo apt-get upgrade -y \ |
10 | | - && sudo apt-get install -y zip ltrace |
| 23 | +# Switch to root to install rust targets and fix permissions |
| 24 | +USER root |
11 | 25 |
|
12 | | -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 26 | +# Install rust targets for cross-compilation |
13 | 27 | RUN rustup update \ |
14 | | - && rustup target add aarch64-unknown-linux-gnu |
| 28 | + && rustup default stable \ |
| 29 | + && rustup target add aarch64-unknown-linux-gnu \ |
| 30 | + && rustup target add x86_64-unknown-linux-gnu |
15 | 31 |
|
16 | | -RUN rustup default stable |
17 | | -# x86_64 to arm64 support. |
18 | | -RUN sudo apt-get install -y \ |
19 | | - qemu \ |
20 | | - binfmt-support \ |
21 | | - qemu-user-static |
| 32 | +# Grant vscode user ownership of rustup and cargo directories |
| 33 | +RUN chown -R vscode:vscode /usr/local/rustup /usr/local/cargo |
22 | 34 |
|
23 | | -# Easy way to install node, ruby, and php |
24 | | -RUN apt-get -y install nodejs ruby php php-common |
25 | | - |
26 | | -# Easy way to install Python. |
27 | | -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 |
| 35 | +# Switch back to vscode user |
| 36 | +USER vscode |
28 | 37 |
|
29 | 38 | # Multi-platform SAM CLI. https://github.com/aws/aws-sam-cli/issues/3908 |
30 | | -RUN apt-get install -y pip && pip install aws-sam-cli |
| 39 | +RUN pip install aws-sam-cli --break-system-packages |
0 commit comments