Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let user set UID used inside cloudcontrol container #158

Open
timdeluxe opened this issue Aug 21, 2024 · 5 comments
Open

Let user set UID used inside cloudcontrol container #158

timdeluxe opened this issue Aug 21, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@timdeluxe
Copy link
Member

When started, cloudcontrol runs with UID 1000 (or sometimes 1001, depending on the flavor). On MacOS that is no problem, because Docker Desktop seems to translate that well enough, however on Linux this causes problems, if f.e. terraform wants to create files in the mounted "repo" folder, which is owned by the UID of the desktop user the user works with and therefore terraform does not work correctly, since it can't create files.

Chowning the repo files to 1000 (or 1001) is very ugly and problematic and also world-write is problematic, so the cloud control container should rather work with the same UID the desktop user uses.

The user should be able to set it and the the container should run with that UID.

@timdeluxe timdeluxe added the bug Something isn't working label Aug 21, 2024
@dploeger
Copy link
Member

Hmm.. Good question how to achieve that. The cloudcontrol user is created during the build, so it can't really change the user id afterwards... 🤔

How about setting user in the docker-compose file? Does that work?

@timdeluxe
Copy link
Member Author

timdeluxe commented Sep 3, 2024

Thomas D. tried it:

Attaching to cli-1
cli-1  | 2024/09/03 07:31:37 Setting bash as default shell
cli-1  | ./ccc: open /home/cloudcontrol/.shell: permission denied
cli-1 exited with code 1

Can't we set the container to run with root and chown and su to the right user with the entrypoint script?

@dploeger
Copy link
Member

dploeger commented Sep 3, 2024

Then the container would basically run as root, which is discouraged usually. I would only use it as a last resort. There has to be some other way.

@timdeluxe
Copy link
Member Author

Some sudo stuff maybe?

@dploeger
Copy link
Member

dploeger commented Sep 3, 2024

That might be an idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants