Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Rust arm64 image, buster variant for back compat #1040

Merged
merged 8 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion containers/rust/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM mcr.microsoft.com/vscode/devcontainers/rust:1
# [Choice] Debian OS version (use bullseye for arm64/Apple Silicon): buster, bullseye
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/rust:1-${VARAINT}

# [Optional] Uncomment this section to install additional packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
Expand Down
4 changes: 3 additions & 1 deletion containers/rust/.devcontainer/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM rust:1
# [Choice] Debian OS version (use bullseye for arm64/Apple Silicon): buster, bullseye
ARG VARIANT="buster"
FROM rust:1-${VARIANT}

# [Option] Install zsh
ARG INSTALL_ZSH="true"
Expand Down
7 changes: 6 additions & 1 deletion containers/rust/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"name": "Rust",
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"args": {
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
// Use bullseye when running locally on arm64/Apple Silicon.
"VARIANT": "buster"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
Expand Down
21 changes: 15 additions & 6 deletions containers/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
| *Categories* | Core, Languages |
| *Definition type* | Dockerfile |
| *Published images* | mcr.microsoft.com/vscode/devcontainers/rust |
| *Published image architecture(s)* | x86-64 |
| *Available image variants* | buster, bullseye ([full list](https://mcr.microsoft.com/v2/vscode/devcontainers/rust/tags/list)) |
| *Published image architecture(s)* | x86-64, arm64/aarch64 for `bullseye` variant |
| *Works in Codespaces* | Yes |
| *Container host OS support* | Linux, macOS, Windows |
| *Container OS* | Debian |
Expand All @@ -20,17 +21,25 @@ See **[history](history)** for information on the contents of published images.

## Using this definition

This definition does not require any special steps to use. Note that the `Cargo.toml` file in the root of this folder is for the test project and can be ignored.
While this definition should work unmodified, you can select the version of Debian the container uses to run Rust by updating the `VARIANT` arg in the included `devcontainer.json` (and rebuilding if you've already created the container).

```json
"args": { "VARIANT": "bullseye" }
```


You can also directly reference pre-built versions of `.devcontainer/base.Dockerfile` by using the `image` property in `.devcontainer/devcontainer.json` or updating the `FROM` statement in your own `Dockerfile` to the following. An example `Dockerfile` is included in this repository.

- `mcr.microsoft.com/vscode/devcontainers/rust` (or `rust:1`)
- `mcr.microsoft.com/vscode/devcontainers/rust:latest` (or `bullseye`, `buster` to pin to an OS version)
- `mcr.microsoft.com/vscode/devcontainers/rust:1` (or `1-bullseye`, `1-buster` to pin to an OS version)

You can decide how often you want updates by referencing a [semantic version](https://semver.org/) of each image. For example:

- `mcr.microsoft.com/vscode/devcontainers/rust:0-1`
- `mcr.microsoft.com/vscode/devcontainers/rust:0.200-1`
- `mcr.microsoft.com/vscode/devcontainers/rust:0.200.4-1`
- `mcr.microsoft.com/vscode/devcontainers/rust:0-1` (or `0-1-bullseye`, `0-1-buster` to pin to an OS version)
- `mcr.microsoft.com/vscode/devcontainers/rust:0.201-1` (or `0.201-1-bullseye`, `0.201-1-buster` to pin to an OS version)
- `mcr.microsoft.com/vscode/devcontainers/rust:0.201.0-1` (or `0.201.0-1-bullseye`, `0.201.0-1-buster` to pin to an OS version)

However, we only do security patching on the latest [non-breaking, in support](https://github.com/microsoft/vscode-dev-containers/issues/532) versions of images (e.g. `0-1`). You may want to run `apt-get update && apt-get upgrade` in your Dockerfile if you lock to a more specific version to at least pick up OS security updates.

See [history](history) for information on the contents of each version and [here for a complete list of available tags](https://mcr.microsoft.com/v2/vscode/devcontainers/rust/tags/list).

Expand Down
22 changes: 17 additions & 5 deletions containers/rust/definition-manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{
"definitionVersion": "0.200.8",
"variants": ["buster", "bullseye"],
"definitionVersion": "0.201.0",
"build": {
"latest": true,
"latest": "buster",
"rootDistro": "debian",
"architectures": {
"bullseye": ["linux/amd64", "linux/arm64"],
"buster": ["linux/amd64"]
},
"tags": [
"rust:${VERSION}-1"
]
"rust:${VERSION}-${VARIANT}"
],
"variantTags": {
"buster": [
"rust:${VERSION}-1",
"rust:${VERSION}-1-buster"
],
"bullseye": [ "rust:${VERSION}-1-bullseye" ]
}
},
"dependencies": {
"image": "rust:1",
"image": "rust:1-${VARIANT}",
"imageLink": "https://hub.docker.com/_/rust",
"apt": [
"lldb",
Expand Down