Skip to content
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
31 changes: 31 additions & 0 deletions .devcontainer/alpine/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Rust (Alpine)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:alpine", // more images at // more images at https://hub.docker.com/r/microsoft/devcontainers-base

// Allow access to host machine
"runArgs": ["--network=host"],

// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
"mounts": [
{
"source": "devcontainer-cargo-cache-alpine-${devcontainerId}",
"target": "/usr/local/cargo",
"type": "volume"
}
],

"onCreateCommand": "sudo apk add --no-cache build-base rust cargo cargo-zsh-completion rust-src rustfmt cbindgen patchelf cmake",

"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"vadimcn.vscode-lldb",
"tamasfe.even-better-toml"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Rust",
"name": "Rust (Ubuntu)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", // more images at https://hub.docker.com/r/microsoft/devcontainers-base

// Allow access to host machine
"runArgs": ["--network=host"],
Expand All @@ -25,14 +25,15 @@
},

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "cargo install cbindgen",
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y patchelf && cargo install cbindgen",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"vadimcn.vscode-lldb"
"vadimcn.vscode-lldb",
"tamasfe.even-better-toml"
]
}
}
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,27 @@ cargo install --locked 'cargo-nextest@0.9.96'

#### Dev Containers

Dev Containers allow you to use a Docker container as a full-featured development environment with VS Code.

##### Prerequisites

- Install the [Dev Containers Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VS Code.
- Docker must be installed and running on your host machine.

##### Available Containers

We provide two Dev Container configurations:
- **Ubuntu**: Full-featured development environment with all dependencies installed
- **Alpine**: Lightweight alternative with minimal dependencies

##### Steps

1. Open a local VS Code window on the cloned repository.
2. Open the command palette (`Ctrl+Shift+P` or `Cmd+Shift+P` on macOS) and select **"Dev Containers: Reopen in Container"**.
3. Choose the **Rust Container**.
4. VS Code will open a new window connected to the selected container.
3. Choose either **Ubuntu** or **Alpine** configuration when prompted.
4. VS Code will build and connect to the selected container environment.

The container includes all necessary dependencies for building and testing `libdatadog`.

#### Docker container
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.
Expand Down
Loading