assetto-server-manager icon indicating copy to clipboard operation
assetto-server-manager copied to clipboard

Running container as non-default user on Linux requires manual file permission changes

Open Jameskmonger opened this issue 2 years ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

It's difficult to get the container to start successfully as the non-default user on Linux without manually changing file permissions to other users.

For example, the user that I want to run the Docker container has ID 1001. When I run the container, the container user has ID 1000 and therefore cannot work with the volume bound to /home/assetto/server-manager/assetto (which is owned by 1001, from the host).

To solve this, I had to manually change the ownership (on the host) of the /assetto volume and the config.yml file to user ID 1000 - but this is a different user.

To Reproduce Steps to reproduce the behavior:

  1. Create an Ubuntu user with an ID besides 1000
  2. Follow the readme to set up the server
  3. The server will fail (see Additional context for logs)

Expected behavior A way to run the container as a specific user without having to set ownership of files elsewhere

Possibly two build args USER_ID and GROUP_ID would help (see https://jtreminio.com/blog/running-docker-containers-as-current-host-user/)

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [Ubuntu 22.04]
  • Browser [N/A]
  • Version [N/A]

Additional context

The error occurred attempting to: Open server manager storage (bolt or json)
The error more specifically is: mkdir assetto/manager: permission denied

I also got an error about creating server_manager.db but I didn't save the log.

Jameskmonger avatar Jan 15 '23 14:01 Jameskmonger

Here to say @Jameskmonger is correct, this is still an issue. I natively run my Docker with a different user and UID, not the standard 1000:1000. I tried setting the UUID and GUIDmultiple times with no luck to a user that has permissions... however the ENV VARS do nothing. After changing my folder permissions on my host withsudo chmod -R 1000:1000 /ac-server` it was finally able to download and get past the permissions issue.

Thanks for the find and creating a ticket, for sure helped me!

requiem240sx avatar May 31 '23 03:05 requiem240sx