Skip to content
Permalink
Browse files

Add debugging in container

  • Loading branch information...
buybackoff committed Jul 14, 2019
1 parent a10ba12 commit 1ef295873864c6c5c49d40c3bcce49911460f657
Showing with 75 additions and 0 deletions.
  1. +39 −0 src/rust/.devcontainer/Dockerfile
  2. +19 −0 src/rust/.devcontainer/devcontainer.json
  3. +17 −0 src/rust/.vscode/launch.json
@@ -0,0 +1,39 @@
FROM rust:1

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
#
# Verify git, needed tools installed
&& apt-get -y install git procps lsb-release \
#
# Install other dependencies
&& apt-get install -y lldb-3.9 \
#
# Install clang
# From https://gist.github.com/twlz0ne/9faf00346a2acf10044c54f9ba0b9805#file-dockerfile
&& apt-get update && apt-get install -y gnupg wget software-properties-common \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
&& apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-6.0 main" \
&& apt-get update && apt-get install -y clang-6.0 \
#
# Install CMake
&& wget https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh \
&& mkdir /opt/cmake \
&& sh cmake-3.8.2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license \
&& ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \
#
# Install Rust components
&& rustup update \
&& rustup component add rls rust-analysis rust-src \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
@@ -0,0 +1,19 @@
{
"name": "Rust",
"dockerFile": "Dockerfile",
"appPort": 9000,
"extensions": [
"rust-lang.rust",
"bungcip.better-toml",
"vadimcn.vscode-lldb"
],
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"settings": {
"lldb.executable": "/usr/bin/lldb-3.9",
"terminal.integrated.shell.linux": "/bin/bash"
}
}
@@ -15,6 +15,23 @@
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false
},
{
"type": "lldb",
"request": "launch",
"name": "Rust Sandbox Container",
"cargo": {
"args": [
"build",
"--bin=sandbox",
"--package=sandbox",
"--manifest-path=Cargo.toml"
],
"filter": {
"kind": "bin"
}
},
"args": []
}
]
}

0 comments on commit 1ef2958

Please sign in to comment.
You can’t perform that action at this time.