From e280f0525800cda91e1932d55ebab5ce1753be3f Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 13 Oct 2023 03:59:45 +0000 Subject: [PATCH] add comments to devcontainer.json --- .devcontainer/.bashrc | 2 ++ .devcontainer/devcontainer.json | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.devcontainer/.bashrc b/.devcontainer/.bashrc index 8afa0af..9c4a80f 100644 --- a/.devcontainer/.bashrc +++ b/.devcontainer/.bashrc @@ -78,3 +78,5 @@ if [ -f ~/.bashrc_dev_container ]; then . ~/.bashrc_dev_container fi + + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 94c6bdc..b32b965 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,9 @@ } }, "remoteEnv": { + // allows X11 apps to run inside the container "DISPLAY": "${localEnv:DISPLAY}", + // provides a name for epics-containers to use in bash prompt etc. "EC_PROJECT": "${localWorkspaceFolderBasename}" }, "customizations": { @@ -30,23 +32,36 @@ } }, // Make sure the files we are mapping into the container exist on the host + // You can place any other outside of the container before-launch commands here "initializeCommand": "bash .devcontainer/initializeCommand ${devcontainerId}", + // Hooks the global .bashprofile_dev_container but also can add any other commands + // to run in the container at creation in here "postCreateCommand": "bash .devcontainer/postCreateCommand ${devcontainerId}", "runArgs": [ + // Allow the container to access the host X11 display and EPICS CA "--net=host", + // Make sure podman can see all host filesystems. WARNING: not compatible with docker "--security-opt=label=disable" ], "workspaceMount": "source=${localWorkspaceFolder},target=/epics/${localWorkspaceFolderBasename},type=bind", "workspaceFolder": "/epics/${localWorkspaceFolderBasename}", "mounts": [ // Mount some useful local files from the user's home directory + // By mounting the parent of the workspace we can work on multiple peer projects "source=${localWorkspaceFolder}/../,target=/repos,type=bind", + // this provides eternal bash history in and out of the container "source=${localEnv:HOME}/.bash_eternal_history,target=/root/.bash_eternal_history,type=bind", + // this bashrc hooks up the .bashrc_dev_container in the following mount "source=${localWorkspaceFolder}/.devcontainer/.bashrc,target=/root/.bashrc,type=bind", + // provides a place for you to put your shell customizations for all your dev containers "source=${localEnv:HOME}/.bashrc_dev_container,target=/root/.bashrc_dev_container,type=bind", + // provides a place to install any packages you want to have across all your dev containers "source=${localEnv:HOME}/.bashprofile_dev_container,target=/root/.bashprofile_dev_container,type=bind", + // ensures your git name and email are set correctly "source=${localEnv:HOME}/.gitconfig,target=/root/.gitconfig,type=bind", + // provides the same command line editing experience as your host "source=${localEnv:HOME}/.inputrc,target=/root/.inputrc,type=bind", + // provides the same ssh keys as your host "source=${localEnv:HOME}/.ssh,target=/root/.ssh,type=bind" ] } \ No newline at end of file