Skip to content

Commit 1ef2958

Browse files
committed
Add debugging in container
1 parent a10ba12 commit 1ef2958

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

src/rust/.devcontainer/Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM rust:1
2+
3+
# Avoid warnings by switching to noninteractive
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
# Configure apt and install packages
7+
RUN apt-get update \
8+
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
9+
#
10+
# Verify git, needed tools installed
11+
&& apt-get -y install git procps lsb-release \
12+
#
13+
# Install other dependencies
14+
&& apt-get install -y lldb-3.9 \
15+
#
16+
# Install clang
17+
# From https://gist.github.com/twlz0ne/9faf00346a2acf10044c54f9ba0b9805#file-dockerfile
18+
&& apt-get update && apt-get install -y gnupg wget software-properties-common \
19+
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
20+
&& apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-6.0 main" \
21+
&& apt-get update && apt-get install -y clang-6.0 \
22+
#
23+
# Install CMake
24+
&& wget https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh \
25+
&& mkdir /opt/cmake \
26+
&& sh cmake-3.8.2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license \
27+
&& ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \
28+
#
29+
# Install Rust components
30+
&& rustup update \
31+
&& rustup component add rls rust-analysis rust-src \
32+
#
33+
# Clean up
34+
&& apt-get autoremove -y \
35+
&& apt-get clean -y \
36+
&& rm -rf /var/lib/apt/lists/*
37+
38+
# Switch back to dialog for any ad-hoc use of apt-get
39+
ENV DEBIAN_FRONTEND=dialog
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Rust",
3+
"dockerFile": "Dockerfile",
4+
"appPort": 9000,
5+
"extensions": [
6+
"rust-lang.rust",
7+
"bungcip.better-toml",
8+
"vadimcn.vscode-lldb"
9+
],
10+
"runArgs": [
11+
"--cap-add=SYS_PTRACE",
12+
"--security-opt",
13+
"seccomp=unconfined"
14+
],
15+
"settings": {
16+
"lldb.executable": "/usr/bin/lldb-3.9",
17+
"terminal.integrated.shell.linux": "/bin/bash"
18+
}
19+
}

src/rust/.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@
1515
"cwd": "${workspaceFolder}",
1616
"environment": [],
1717
"externalConsole": false
18+
},
19+
{
20+
"type": "lldb",
21+
"request": "launch",
22+
"name": "Rust Sandbox Container",
23+
"cargo": {
24+
"args": [
25+
"build",
26+
"--bin=sandbox",
27+
"--package=sandbox",
28+
"--manifest-path=Cargo.toml"
29+
],
30+
"filter": {
31+
"kind": "bin"
32+
}
33+
},
34+
"args": []
1835
}
1936
]
2037
}

0 commit comments

Comments
 (0)