-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description This PR presents a complete devcontainer environment for building with the CoW Protocol services repository. # Changes - [x] Build using the latest standard `rust` devcontainer - [x] Enhance the `rust` devcontainer with `gdb`, `valgrind`, and `heaptrack` - [x] Installs both `stable` and `nightly` toolchains, automatically configuring rust-analyzer to use `nightly` for `rustfmt` - [x] Includes `docker`, `postgresql-client` and `node` for development - [x] Configures the `zsh` shell - [x] Adjusts docker settings to enable trace capabilities for profiling development ## How to test 1. Open in VS Code and take it for a spin **Caution**: This can take a while to build the container environment on first start.
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:bullseye | ||
|
||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131 | ||
&& apt-get purge -y imagemagick imagemagick-6-common | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends gdb valgrind heaptrack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"build": { | ||
"dockerfile": "./Dockerfile", | ||
"context": "." | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": true, | ||
"configureZshAsDefaultShell": true, | ||
"installOhMyZsh": true, | ||
"installOhMyZshConfig": true, | ||
"upgradePackages": true, | ||
"username": "automatic", | ||
"userUid": "automatic", | ||
"userGid": "automatic" | ||
}, | ||
"ghcr.io/devcontainers/features/rust:1": {}, | ||
"ghcr.io/devcontainers/features/git:1": {}, | ||
"ghcr.io/nlordell/features/foundry": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": { | ||
"dockerDashComposeVersion": "v2" | ||
}, | ||
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {}, | ||
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": { | ||
"plugins": "npm git rust docker docker-compose git-prompt postgres", | ||
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions", | ||
"username": "vscode" | ||
} | ||
}, | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined" | ||
], | ||
|
||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"rust-analyzer.rustfmt.extraArgs": [ | ||
"+nightly" | ||
] | ||
}, | ||
"extensions": [ | ||
"rust-lang.rust-analyzer", | ||
"serayuzgur.crates" | ||
] | ||
} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "rustc --version", | ||
"postCreateCommand": "rustup toolchain install nightly && cargo install flamegraph", | ||
|
||
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |