Replies: 1 comment
-
You could install the packages using a Dockerfile. That has the advantage of using Docker's layer cache. If you have to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using
devcontainer
in VSCode, I am facing an issue with the following scenario:In the
image
, I configure theonCreateCommand
to execute commands requiring root privileges, such as:However, the final
user
in the container is notroot
, but something likeappuser
. For this reason, I set the following configurations indevcontainer.json
:Despite these settings, the commands in
onCreateCommand
are still executed asappuser
, resulting in permission errors.My Goal:
I want to execute the
onCreateCommand
asroot
during the container's initialization phase and then switch back toappuser
afterward for development purposes.Key Considerations:
root
as the final user in the container.root
as the container user can cause issues, such as files created within the dev container being owned byroot
, which complicates file handling outside the container.Question:
Does anyone have a good solution or best practice to achieve this? Ideally, I want the container to start as
root
during initialization and then automatically switch toappuser
afterward. Any insights or advice would be greatly appreciated!Beta Was this translation helpful? Give feedback.
All reactions