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

Commit 37aede8

Browse files
authored
Fix install of dotnet in devcontainer (#3176)
* Install dotnet from Ubuntu package sources * Update to more recent devcontainer format
1 parent f724741 commit 37aede8

File tree

2 files changed

+39
-47
lines changed

2 files changed

+39
-47
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,18 @@
22

33
ARG VARIANT="ubuntu-22.04"
44

5-
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
5+
FROM mcr.microsoft.com/devcontainers/base:${VARIANT}
66

77
# note: keep this in sync with .github/workflows/ci.yml
88
ARG RUSTVERSION="1.69"
99

10-
# Needed for dotnet7; remove when available in Ubuntu
11-
RUN wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
12-
&& sudo dpkg -i packages-microsoft-prod.deb \
13-
&& rm packages-microsoft-prod.deb
14-
1510
# Install packages required for build:
1611
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1712
&& apt-get -y install --no-install-recommends \
1813
libunwind-dev clang build-essential libssl-dev pkg-config lldb \
1914
bash-completion npm \
2015
python-is-python3 direnv uuid-runtime python3-distutils python3-pip python3-venv \
21-
dotnet-sdk-7.0 gh
22-
# TODO replace with dotnet7 when available in Ubuntu
16+
dotnet7 gh
2317

2418
# Install Rust:
2519
USER vscode

.devcontainer/devcontainer.json

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,49 @@
33
{
44
"name": "Ubuntu",
55
"build": {
6-
"dockerfile": "Dockerfile",
6+
"dockerfile": "Dockerfile"
77
},
8-
// Set *default* container specific settings.json values on container create.
9-
"settings": {
10-
"lldb.executable": "/usr/bin/lldb",
11-
"files.watcherExclude": {
12-
"**/target/**": true
13-
},
14-
"rust-analyzer.checkOnSave.command": "clippy",
15-
"rust-analyzer.linkedProjects": [
16-
"/workspaces/onefuzz/src/agent/Cargo.toml",
17-
"/workspaces/onefuzz/src/proxy-manager/Cargo.toml"
18-
],
19-
"python.defaultInterpreterPath": "/workspaces/onefuzz/src/venv/bin/python",
20-
"python.formatting.provider": "black",
21-
"python.linting.flake8Enabled": true,
22-
"python.linting.mypyEnabled": true,
23-
"omnisharp.enableRoslynAnalyzers": true,
24-
"omnisharp.enableEditorConfigSupport": true,
25-
"editor.formatOnSave": true
8+
"customizations": {
9+
"vscode": {
10+
"settings": {
11+
"editor.formatOnSave": true,
12+
"files.watcherExclude": {
13+
"**/target/**": true
14+
},
15+
"lldb.executable": "/usr/bin/lldb",
16+
"omnisharp.enableEditorConfigSupport": true,
17+
"omnisharp.enableRoslynAnalyzers": true,
18+
"python.defaultInterpreterPath": "/workspaces/onefuzz/src/venv/bin/python",
19+
"python.formatting.provider": "black",
20+
"python.linting.flake8Enabled": true,
21+
"python.linting.mypyEnabled": true,
22+
"rust-analyzer.checkOnSave.command": "clippy",
23+
"rust-analyzer.linkedProjects": [
24+
"/workspaces/onefuzz/src/agent/Cargo.toml",
25+
"/workspaces/onefuzz/src/proxy-manager/Cargo.toml"
26+
]
27+
},
28+
"extensions": [
29+
"formulahendry.dotnet-test-explorer",
30+
"ms-azuretools.vscode-azurefunctions",
31+
"ms-azuretools.vscode-bicep",
32+
"ms-dotnettools.csharp",
33+
"ms-python.python",
34+
"mutantdino.resourcemonitor",
35+
"redhat.vscode-yaml",
36+
"rust-lang.rust-analyzer",
37+
"serayuzgur.crates",
38+
"tamasfe.even-better-toml",
39+
"vadimcn.vscode-lldb"
40+
]
41+
}
2642
},
27-
// Add the IDs of extensions you want installed when the container is created.
28-
"extensions": [
29-
"vadimcn.vscode-lldb",
30-
"mutantdino.resourcemonitor",
31-
"rust-lang.rust-analyzer",
32-
"tamasfe.even-better-toml",
33-
"serayuzgur.crates",
34-
"ms-dotnettools.csharp",
35-
"ms-python.python",
36-
"ms-azuretools.vscode-bicep",
37-
"formulahendry.dotnet-test-explorer",
38-
"ms-azuretools.vscode-azurefunctions",
39-
"redhat.vscode-yaml"
40-
],
41-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
42-
// "forwardPorts": [],
4343
// Use 'postCreateCommand' to run commands after the container is created.
4444
// Run as interactive bash shell to pick up .bashrc so that direnv is set up:
4545
"postCreateCommand": "bash -i .devcontainer/post-create-script.sh",
46-
// - ensure all nuget packages are present
47-
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
4846
"remoteUser": "vscode",
49-
// Note: available features are listed in: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/container-features/src/devcontainer-features.json
47+
// Note: available features are found in: https://github.com/devcontainers/features/blob/main/README.md
5048
"features": {
51-
"azure-cli": "latest"
49+
"ghcr.io/devcontainers/features/azure-cli:1": {}
5250
}
5351
}

0 commit comments

Comments
 (0)