-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 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,19 @@ | ||
FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04 | ||
|
||
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.22.2" | ||
|
||
# Optionally install the cmake for vcpkg | ||
COPY ./reinstall-cmake.sh /tmp/ | ||
|
||
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \ | ||
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \ | ||
fi \ | ||
&& rm -f /tmp/reinstall-cmake.sh | ||
|
||
# [Optional] Uncomment this section to install additional vcpkg ports. | ||
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>" | ||
|
||
# [Optional] Uncomment this section to install additional packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends openmpi-common openmpi-bin libopenmpi-dev clang-format | ||
|
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,37 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp | ||
{ | ||
"name": "HiRep", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
"containerEnv": { "TZ": "Europe/Rome" }, | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": { | ||
"git-hooks": "ln -sf /workspaces/${localWorkspaceFolderBasename}/Make/git-hooks-pre-commit /workspaces/${localWorkspaceFolderBasename}/.git/hooks/pre-commit", | ||
"python3": "sudo ln -s /usr/bin/python3 /usr/bin/python" | ||
}, | ||
"postStartCommand": { | ||
"setupenv": "printenv > .devcontainer/container.env" | ||
}, | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"eamodio.gitlens", | ||
"ms-vscode-remote.remote-containers", | ||
"ms-vscode.cpptools-extension-pack", | ||
"ms-azuretools.vscode-dockert", | ||
"ms-vscode.cpptools-themes" | ||
] | ||
} | ||
} | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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 @@ | ||
docker exec -it -w /workspaces/$(basename `pwd`) -u vscode --env-file="$(pwd)/.devcontainer/container.env" $(awk -F'=' '$1=="HOSTNAME" { print $2 }' "$(pwd)/.devcontainer/container.env") zsh |