Caching home directory for remoteUser after feature install#774
Open
prulloac wants to merge 1 commit intodevcontainers:mainfrom
Open
Caching home directory for remoteUser after feature install#774prulloac wants to merge 1 commit intodevcontainers:mainfrom
prulloac wants to merge 1 commit intodevcontainers:mainfrom
Conversation
samruddhikhandale
requested changes
Mar 20, 2024
a98cb17 to
960d02a
Compare
mtrackeros
approved these changes
Mar 23, 2024
AZOLOOK
approved these changes
Mar 25, 2024
Contributor
|
Tests need to be updated (see test failures). It would also be great to have a test specifically for this where a first feature creates a user and a second feature then checks if the env variables are updated correctly. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds coalescing logic following how commons-utils feature handles home directories for users that do not have one from source image. [Updated]Caching container user home directory and remote user home directory after any feature installs, this will increase build time in a matter of milliseconds but will ensure that after each feature layer, the
_CONTAINER_USER_HOMEand_REMOTE_USER_HOMEwill be updated and cached for the next feature to be installed.This should solve issue #331 .
Open to suggestions on how to improve, adding same coalesce for
_CONTAINER_USER_HOMEdoes not break anything, but didn't want to include that until told otherwise by maintainers.Locally tested as follows:
{ "name": "test", "image": "ubuntu:jammy", "features": { "ghcr.io/devcontainers/features/common-utils:2": { "username": "vscode", "installZsh": true, "installOhMyZsh": true, "upgradePackages": true }, "ghcr.io/stuartleeks/dev-container-features/shell-history:0": {} }, "remoteUser": "vscode" }node devcontainer.js build --config test/devcontainer.json --workspace-folder .node devcontainer.js up --config test/devcontainer.json --workspace-folder .docker exec -it <CONTAINER_NAME> shshell-historyfeature installed correctly for the newly created userTested with host: