File tree Expand file tree Collapse file tree 3 files changed +49
-6
lines changed Expand file tree Collapse file tree 3 files changed +49
-6
lines changed Original file line number Diff line number Diff line change
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/rust
3
+ {
4
+ "name" : " Rust (Alpine)" ,
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image" : " mcr.microsoft.com/devcontainers/base:alpine" , // more images at // more images at https://hub.docker.com/r/microsoft/devcontainers-base
7
+
8
+ // Allow access to host machine
9
+ "runArgs" : [" --network=host" ],
10
+
11
+ // Use 'mounts' to make the cargo cache persistent in a Docker Volume.
12
+ "mounts" : [
13
+ {
14
+ "source" : " devcontainer-cargo-cache-alpine-${devcontainerId}" ,
15
+ "target" : " /usr/local/cargo" ,
16
+ "type" : " volume"
17
+ }
18
+ ],
19
+
20
+ "onCreateCommand" : " sudo apk add --no-cache build-base rust cargo cargo-zsh-completion rust-src rustfmt cbindgen patchelf cmake" ,
21
+
22
+ "customizations" : {
23
+ "vscode" : {
24
+ "extensions" : [
25
+ " rust-lang.rust-analyzer" ,
26
+ " vadimcn.vscode-lldb" ,
27
+ " tamasfe.even-better-toml"
28
+ ]
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change 1
1
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
2
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
3
3
{
4
- "name" : " Rust" ,
4
+ "name" : " Rust (Ubuntu) " ,
5
5
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
- "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
6
+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" , // more images at https://hub.docker.com/r/microsoft/devcontainers-base
7
7
8
8
// Allow access to host machine
9
9
"runArgs" : [" --network=host" ],
25
25
},
26
26
27
27
// Use 'postCreateCommand' to run commands after the container is created.
28
- "postCreateCommand" : " cargo install cbindgen" ,
28
+ "postCreateCommand" : " sudo apt-get update && sudo apt-get install -y patchelf && cargo install cbindgen" ,
29
29
30
30
// Configure tool-specific properties.
31
31
"customizations" : {
32
32
"vscode" : {
33
33
"extensions" : [
34
34
" rust-lang.rust-analyzer" ,
35
- " vadimcn.vscode-lldb"
35
+ " vadimcn.vscode-lldb" ,
36
+ " tamasfe.even-better-toml"
36
37
]
37
38
}
38
39
}
Original file line number Diff line number Diff line change 64
64
65
65
#### Dev Containers
66
66
67
+ Dev Containers allow you to use a Docker container as a full-featured development environment with VS Code.
68
+
67
69
##### Prerequisites
68
70
69
71
- Install the [ Dev Containers Extension] ( https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers ) in VS Code.
72
+ - Docker must be installed and running on your host machine.
73
+
74
+ ##### Available Containers
75
+
76
+ We provide two Dev Container configurations:
77
+ - ** Ubuntu** : Full-featured development environment with all dependencies installed
78
+ - ** Alpine** : Lightweight alternative with minimal dependencies
70
79
71
80
##### Steps
72
81
73
82
1 . Open a local VS Code window on the cloned repository.
74
83
2 . Open the command palette (` Ctrl+Shift+P ` or ` Cmd+Shift+P ` on macOS) and select ** "Dev Containers: Reopen in Container"** .
75
- 3 . Choose the ** Rust Container** .
76
- 4 . VS Code will open a new window connected to the selected container.
84
+ 3 . Choose either ** Ubuntu** or ** Alpine** configuration when prompted.
85
+ 4 . VS Code will build and connect to the selected container environment.
86
+
87
+ The container includes all necessary dependencies for building and testing ` libdatadog ` .
77
88
78
89
#### Docker container
79
90
A dockerfile is provided to run tests in a Ubuntu linux environment. This is particularly useful for running and debugging linux-only tests on macOS.
You can’t perform that action at this time.
0 commit comments