-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set devcontainer. Add test scenarios. Set exception safety.
- Loading branch information
1 parent
9db3f97
commit a7c4da5
Showing
12 changed files
with
225 additions
and
39 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
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,51 @@ | ||
# Use the official Ubuntu base image | ||
FROM ubuntu:20.04 | ||
|
||
# Avoid interactive package installation | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install required packages | ||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
cmake \ | ||
clang-tidy \ | ||
clang-format \ | ||
lcov \ | ||
git \ | ||
curl \ | ||
wget \ | ||
unzip \ | ||
python3 \ | ||
python3-pip \ | ||
gdb \ | ||
lldb \ | ||
clang \ | ||
llvm \ | ||
nano \ | ||
software-properties-common \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Create a non-root user | ||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
RUN groupadd -g $USER_GID $USERNAME || true \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \ | ||
&& apt update \ | ||
&& apt install -y sudo \ | ||
&& echo $USERNAME ALL=\(ALL\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
# History | ||
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \ | ||
&& mkdir /commandhistory \ | ||
&& touch /commandhistory/.bash_history \ | ||
&& chown -R $USERNAME /commandhistory \ | ||
&& echo "$SNIPPET" >> "/home/$USERNAME/.bashrc" | ||
|
||
# Set the user to vscode | ||
USER $USERNAME | ||
|
||
# Set the workspace directory | ||
WORKDIR /workspace |
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,31 @@ | ||
{ | ||
"name": "C++ Development with CMake and Bazel", | ||
"dockerFile": "Dockerfile", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cmake-tools", | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cpptools-extension-pack", | ||
"xaver.clang-format", | ||
"twxs.cmake", | ||
"fredericbonnet.cmake-test-adapter", | ||
"ms-vscode.cmake-tools", | ||
"notskm.clang-tidy", | ||
"ryanluker.vscode-coverage-gutters", | ||
] | ||
} | ||
}, | ||
"mounts": [ | ||
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", | ||
"source=${env:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached", | ||
"source=history,target=/commandhistory,type=volume" | ||
], | ||
"workspaceFolder": "/workspace", | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined" | ||
], | ||
"remoteUser": "vscode" | ||
} |
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
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 |
---|---|---|
@@ -1,12 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cpptools-extension-pack", | ||
"xaver.clang-format", | ||
"twxs.cmake", | ||
"fredericbonnet.cmake-test-adapter", | ||
"ms-vscode.cmake-tools", | ||
"notskm.clang-tidy", | ||
"ryanluker.vscode-coverage-gutters", | ||
"ms-vscode-remote.remote-containers", | ||
] | ||
} |
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
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
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
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
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
Oops, something went wrong.