You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When developing my application, the default user of the container is root, but I am also creating a custom user (appuser) that I switch to when attaching to the container.
The issue is that the files being synced into the container are owned by root:root, so that the application is not able to create/modify/delete files within the container.
I have a startup script that basically looks like this:
#!/usr/bin/env bash
devspace deploy
# Initial file sync into the container
devspace sync --initial-sync preferLocal --no-watch --pod <pod-name> --container app
devspace dev --skip-build --skip-deploy
Afterward, the files are constantly being synced (bidirectional):
devspace.yml (excerpt):
FROM php:8.3
RUN useradd -u <id-of-the-host-user> -g <id-of-the-host-group> appuser
There is no USER appuser, as I want to keep root as default user, but I am switching to appuser when entering the container in the .bashrc file.
I tried USER appuser anyway of course, but then the sync fails:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When developing my application, the default user of the container is
root
, but I am also creating a custom user (appuser
) that I switch to when attaching to the container.The issue is that the files being synced into the container are owned by
root:root
, so that the application is not able to create/modify/delete files within the container.I have a startup script that basically looks like this:
Afterward, the files are constantly being synced (bidirectional):
devspace.yml (excerpt):
The Dockerfile:
There is no
USER appuser
, as I want to keeproot
as default user, but I am switching toappuser
when entering the container in the .bashrc file.I tried
USER appuser
anyway of course, but then the sync fails:What do I need to do in order to keep the file owners of my host when syncing to the container?
Beta Was this translation helpful? Give feedback.
All reactions