Skip to content

Commit fe5188f

Browse files
authored
can choose between docs and no-docs containers, saving gigs of disk space (#395)
1 parent bfbb92f commit fe5188f

File tree

3 files changed

+41
-14
lines changed

3 files changed

+41
-14
lines changed

.devcontainer/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04
2-
FROM mcr.microsoft.com/devcontainers/cpp:dev-ubuntu-24.04
2+
FROM mcr.microsoft.com/devcontainers/cpp:dev-ubuntu-24.04 AS base
33

4-
RUN apt update && export DEBIAN_FRONTEND=noninteractive && apt -y install clangd-19 clang-tidy-19 openmpi-bin openmpi-doc libopenmpi-dev python3-sphinx python3-breathe doxygen python3-sphinx-rtd-theme texlive-full
4+
RUN apt update && export DEBIAN_FRONTEND=noninteractive && apt -y install clangd-19 clang-tidy-19 openmpi-bin openmpi-doc libopenmpi-dev
55
RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-19 100
6-
RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 100
6+
RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 100
7+
8+
# No docs variant - minimal version without documentation tools
9+
FROM base AS no_docs
10+
# Inherits base without any additional packages
11+
12+
# Full variant - adds documentation tools
13+
FROM base AS full
14+
RUN apt update && export DEBIAN_FRONTEND=noninteractive && apt -y install python3-sphinx python3-breathe doxygen python3-sphinx-rtd-theme texlive-full
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
33
{
4-
"name": "YGM",
4+
"name": "YGM (Full with Docs)",
55
"build": {
6-
"dockerfile": "Dockerfile"
6+
"dockerfile": "../Dockerfile",
7+
"target": "full"
78
},
89
// Features to add to the dev container. More info: https://containers.dev/features.
910
// "features": {},
1011
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1112
// "forwardPorts": [],
1213
// Use 'postCreateCommand' to run commands after the container is created.
1314
// "postCreateCommand": "uname -a",
14-
"extensions": [
15-
"llvm-vs-code-extensions.vscode-clangd",
16-
// add other extensions as needed
17-
]
15+
"customizations": {
16+
"vscode": {
17+
"extensions": [
18+
"llvm-vs-code-extensions.vscode-clangd"
19+
]
20+
}
21+
},
1822
"mounts": [
19-
"source=${localEnv:HOME}${localEnv:USERPROFILE},target=/host-home,type=bind,consistency=cached",
23+
"source=${localEnv:HOME}${localEnv:USERPROFILE},target=/host-home,type=bind,consistency=cached"
2024
]
21-
// Configure tool-specific properties.
22-
// "customizations": {},
23-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
24-
// "remoteUser": "root"
2525
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
3+
{
4+
"name": "YGM (No Docs)",
5+
"build": {
6+
"dockerfile": "../Dockerfile",
7+
"target": "no_docs"
8+
},
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"llvm-vs-code-extensions.vscode-clangd"
13+
]
14+
}
15+
},
16+
"mounts": [
17+
"source=${localEnv:HOME}${localEnv:USERPROFILE},target=/host-home,type=bind,consistency=cached"
18+
]
19+
}

0 commit comments

Comments
 (0)