Skip to content

Commit 0bba1c9

Browse files
committed
use final verison of devcontainer and dockerfile
1 parent 916112f commit 0bba1c9

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ RUN mkdir -p /workdir /tmp && \
1919
libssl-dev libudev-dev bash && \
2020
rm -rf /var/lib/apt/lists/*
2121

22-
RUN rustup component add rustfmt clippy
22+
RUN rustup install 1.78.0 \
23+
&& rustup component add rustfmt clippy --toolchain 1.78.0
2324

2425
RUN curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" -o /tmp/node.tar.xz \
2526
&& tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \
@@ -43,6 +44,6 @@ RUN solana-keygen new --no-bip39-passphrase --force \
4344

4445
RUN apt-get update && apt-get install -y zsh curl git \
4546
&& sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \
46-
&& chsh -s /usr/bin/zsh vscode
47+
&& chsh -s /usr/bin/zsh root
4748

4849
WORKDIR /workdir

.devcontainer/devcontainer.json

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Drift Protocol Development (amd64, root)",
2+
"name": "Drift Protocol Development",
33
"build": {
44
"dockerfile": "Dockerfile",
55
"platform": "linux/amd64"
@@ -10,7 +10,7 @@
1010
"source=${localWorkspaceFolder},target=/workdir,type=bind,consistency=cached",
1111
"source=drift-target,target=/workdir/target,type=volume,consistency=delegated"
1212
],
13-
"postCreateCommand": "echo 'Dev container ready. Run: anchor build / anchor test / cargo build'",
13+
"postCreateCommand": "yarn config set ignore-package-manager true && echo 'Dev container ready! You can now run: anchor build, anchor test, cargo build, etc.'",
1414
"customizations": {
1515
"vscode": {
1616
"extensions": [
@@ -19,19 +19,36 @@
1919
"tamasfe.even-better-toml"
2020
],
2121
"settings": {
22+
"rust-analyzer.cachePriming.numThreads": 1,
2223
"rust-analyzer.cargo.buildScripts.enable": true,
2324
"rust-analyzer.procMacro.enable": true,
24-
"terminal.integrated.defaultProfile.linux": "bash"
25+
"rust-analyzer.checkOnSave": true,
26+
"rust-analyzer.check.command": "clippy",
27+
"rust-analyzer.server.extraEnv": {
28+
"NODE_OPTIONS": "--max-old-space-size=4096",
29+
"RUSTUP_TOOLCHAIN": "1.78.0-x86_64-unknown-linux-gnu"
30+
},
31+
"editor.formatOnSave": true,
32+
"git.ignoreLimitWarning": true
2533
}
2634
}
2735
},
28-
"forwardPorts": [8899, 8900],
36+
"forwardPorts": [
37+
8899,
38+
8900
39+
],
2940
"portsAttributes": {
30-
"8899": { "label": "Solana Test Validator", "onAutoForward": "notify" },
31-
"8900": { "label": "Solana Test Validator RPC", "onAutoForward": "notify" }
41+
"8899": {
42+
"label": "Solana Test Validator",
43+
"onAutoForward": "notify"
44+
},
45+
"8900": {
46+
"label": "Solana Test Validator RPC",
47+
"onAutoForward": "notify"
48+
}
3249
},
3350
"containerEnv": {
3451
"ANCHOR_WALLET": "/root/.config/solana/id.json",
3552
"RUST_LOG": "solana_runtime::message_processor::stable_log=debug"
3653
}
37-
}
54+
}

0 commit comments

Comments
 (0)