Skip to content

Commit 85d10bf

Browse files
committed
Initial commit of Dockerfile
1 parent 1066e0e commit 85d10bf

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed

.vscode/tasks.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "docker build",
8+
"type": "shell",
9+
"command": "docker build -t cblauvelt/vscode-cpp .",
10+
"problemMatcher": [],
11+
"group": {
12+
"kind": "build",
13+
"isDefault": true
14+
}
15+
}
16+
]
17+
}

Dockerfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/cpp/.devcontainer/base.Dockerfile
2+
3+
FROM mcr.microsoft.com/vscode/devcontainers/base:0-ubuntu-20.04
4+
5+
ENV GCC_VERSION=10 \
6+
CLANG_VERSION=11 \
7+
CONAN_VERSION="1.38.0" \
8+
CONAN_PKG_VERSION="0.35.1" \
9+
CMAKE_VERSION_FULL=3.18.2 \
10+
CC=/usr/bin/gcc \
11+
CXX=/usr/bin/g++ \
12+
PYENV_ROOT=/opt/pyenv \
13+
PYTHON_VERSION=3.7.5 \
14+
PATH=/opt/pyenv/shims:${PATH} \
15+
DEBIAN_FRONTEND=noninteractive
16+
17+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
18+
19+
# hadolint ignore=DL3008
20+
RUN apt-get -qq update \
21+
&& apt-get -qq install -y --no-install-recommends --no-install-suggests \
22+
sudo \
23+
binutils \
24+
wget \
25+
git \
26+
libc6-dev \
27+
g++-${GCC_VERSION} \
28+
clang-${CLANG_VERSION} \
29+
clang-tidy \
30+
cppcheck \
31+
valgrind \
32+
gdb \
33+
libgmp-dev \
34+
libmpfr-dev \
35+
libmpc-dev \
36+
nasm \
37+
dh-autoreconf \
38+
ninja-build \
39+
libffi-dev \
40+
libssl-dev \
41+
pkg-config \
42+
subversion \
43+
zlib1g-dev \
44+
libbz2-dev \
45+
libsqlite3-dev \
46+
libreadline-dev \
47+
xz-utils \
48+
curl \
49+
libncurses5-dev \
50+
libncursesw5-dev \
51+
liblzma-dev \
52+
ca-certificates \
53+
autoconf-archive \
54+
python \
55+
pip \
56+
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 100 \
57+
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${GCC_VERSION} 100 \
58+
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 \
59+
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${GCC_VERSION} 100 \
60+
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} 100 \
61+
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 100 \
62+
&& ln -s /usr/include/locale.h /usr/include/xlocale.h \
63+
&& rm -rf /var/lib/apt/lists/* \
64+
&& curl -fL https://getcli.jfrog.io | sh \
65+
&& mv jfrog /usr/local/bin/jfrog \
66+
&& chmod +x /usr/local/bin/jfrog \
67+
&& groupadd 1001 -g 1001 \
68+
&& groupadd 2000 -g 2000 \
69+
&& groupadd 999 -g 999 \
70+
&& usermod -aG 1001,2000,999 vscode \
71+
&& pip install -q --upgrade --no-cache-dir pip==21.2.1 \
72+
&& pip install -q --no-cache-dir conan==${CONAN_VERSION} conan-package-tools==${CONAN_PKG_VERSION} cmake==${CMAKE_VERSION_FULL}
73+

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,44 @@
11
# docker-vscode-cpp
2+
23
A VSCode remote capable container that contains gcc, clang, and conan package manager
4+
5+
## Component Versions
6+
7+
| Package | Version |
8+
| ------- | ----------------------------------------- |
9+
| GCC | gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0 |
10+
| Clang | clang version 11.0.0-2~ubuntu20.04.1 |
11+
| CMake | cmake version 3.18.2 |
12+
13+
## Example devcontainer file
14+
15+
Below is a sample .devcontainer file that you can use for your project. It includes an example on how to add your own conan remote.
16+
17+
```json
18+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
19+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/cpp
20+
{
21+
"name": "C++",
22+
"image": "vscode-cpp",
23+
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
24+
// Set *default* container specific settings.json values on container create.
25+
"settings": {},
26+
// Add the IDs of extensions you want installed when the container is created.
27+
"extensions": [
28+
"ms-vscode.cpptools",
29+
"ms-vscode.cpptools-extension-pack",
30+
"ms-vsliveshare.vsliveshare",
31+
"cschlosser.doxdocgen"
32+
],
33+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
34+
// "forwardPorts": [],
35+
// Mount the conan directory
36+
"mounts": ["source=conan,target=/home/vscode/.conan"],
37+
// Use 'postCreateCommand' to run commands after the container is created.
38+
// Use False if you're using a remote with a valid https cert.
39+
// --insert without a parameter places it first in the list when searching for a package
40+
"postCreateCommand": "conan remote add <remote-name> https://<ip-address>/artifactory/api/conan/conan-local False --insert",
41+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
42+
"remoteUser": "vscode"
43+
}
44+
```

0 commit comments

Comments
 (0)