Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devcontainer' into development
- Loading branch information
Showing
4 changed files
with
88 additions
and
6 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,50 @@ | ||
#------------------------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
#------------------------------------------------------------------------------------------------------------- | ||
|
||
FROM debian:9 | ||
|
||
# Avoid warnings by switching to noninteractive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux, | ||
# this user's GID/UID must match your local user UID/GID to avoid permission issues | ||
# with bind mounts. Update USER_UID / USER_GID if yours is not 1000. See | ||
# https://aka.ms/vscode-remote/containers/non-root-user for details. | ||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Configure apt and install packages | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ | ||
# | ||
# Verify git, process tools, lsb-release (useful for CLI installs) installed | ||
&& apt-get -y install git iproute2 procps lsb-release \ | ||
# | ||
# Install C++ tools | ||
&& apt-get -y install build-essential cppcheck valgrind \ | ||
# | ||
## Install newer version of CMake (OpenJPH requires 3.10+, debian has older version) | ||
&& apt-get install wget \ | ||
&& wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz \ | ||
&& tar -zxvf cmake-3.15.2.tar.gz \ | ||
&& (cd /cmake-3.15.2; ./bootstrap; make -j2 install)\ | ||
&& rm -rf /cmake-3.15.2\ | ||
# | ||
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. | ||
&& groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
# [Optional] Add sudo support for the non-root user | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME \ | ||
# | ||
# 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= |
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 @@ | ||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at | ||
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/cpp | ||
{ | ||
"name": "C++", | ||
"dockerFile": "Dockerfile", | ||
"runArgs": [ | ||
// Uncomment the next line to use a non-root user. On Linux, this will prevent | ||
// new files getting created as root, but you may need to update the USER_UID | ||
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000. | ||
// "-u", "vscode", | ||
|
||
"--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" | ||
], | ||
|
||
// Use 'settings' to set *default* container specific settings.json values on container create. | ||
// You can edit these settings after create using File > Preferences > Settings > Remote. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash" | ||
}, | ||
|
||
// Uncomment the next line if you want to publish any ports. | ||
// "appPort": [], | ||
|
||
// Uncomment the next line to run commands after the container is created. | ||
// "postCreateCommand": "gcc -v", | ||
|
||
// Add the IDs of extensions you want installed when the container is created in the array below. | ||
"extensions": [ | ||
"ms-vscode.cpptools" | ||
] | ||
} |
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,2 @@ | ||
#!/bin/bash | ||
docker run -it --user $(id -u):$(id -g) -v "$(cd ../.. && pwd)":/src trzeci/emscripten /bin/bash |