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

Make UserID and Group ID of www-data match with host #1081

Closed
uchagani opened this issue Apr 18, 2020 · 4 comments
Closed

Make UserID and Group ID of www-data match with host #1081

uchagani opened this issue Apr 18, 2020 · 4 comments
Labels

Comments

@uchagani
Copy link

I'm running Ubuntu 19.10 as my host OS.

I've ran into an issue where the user id and the group id of the www-data user/group are different on my host and in the nextcloud containers. This makes it difficult to move the data directory.

In order to get this to work I had to do the following:

  1. Get UID/GID for the www-data user in the nextcloud docker container
  2. Create data dir on the host
  3. Create a user/group on the host with the UID/GID of the www-data user from the nextcloud docker container (82:82 in my case)
  4. Change ownership of the data directory to the user/group created in step 3.
  5. recreate the docker-containers
@J0WI J0WI added the wontfix label Apr 18, 2020
@J0WI
Copy link
Contributor

J0WI commented Apr 18, 2020

There's no need to create a user on the host. You can chown 82:82 on the host, chown www-data:www-data in the container (using docker exec) or docker run --user to run the container as custom user.

@rgarrigue
Copy link

Why don't you add a UID & GID environment variable defaulting to 33 (default for www-data) to be able to specify the container's data UID & GID ?

It would be way more convenient to integrate with other containers downloading files (like boypt/cloud-torrent for example)

@BlauerPulli
Copy link

@J0WI depending on the host setup running the whole container as non-root can lead to other problems (e.g docker socket is not able to bind port 80 / other permission problems). I think it would be a nice feature (besides it seems to be a good practice in other docker projects) to especially set the uid/gid for the user who writes data.

@rgarrigue but this was discussed in two other threads:
#359
#659

and if you need this feature urgently i think you have to implement it.. 😄

J0WI added a commit to J0WI/docker-nextcloud that referenced this issue Sep 1, 2022
fix: nextcloud#359, nextcloud#772, nextcloud#1081, nextcloud#1087, nextcloud#1278

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
J0WI added a commit to J0WI/docker-nextcloud that referenced this issue Sep 1, 2022
fix: nextcloud#359, nextcloud#772, nextcloud#1081, nextcloud#1087, nextcloud#1278

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
J0WI added a commit that referenced this issue Sep 6, 2022
fix: #359, #772, #1081, #1087, #1278

Signed-off-by: J0WI <J0WI@users.noreply.github.com>

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
@J0WI
Copy link
Contributor

J0WI commented Sep 6, 2022

closing due #1812

@J0WI J0WI closed this as completed Sep 6, 2022
ananace pushed a commit to ananace/docker-nextcloud that referenced this issue May 10, 2024
fix: nextcloud#359, nextcloud#772, nextcloud#1081, nextcloud#1087, nextcloud#1278

Signed-off-by: J0WI <J0WI@users.noreply.github.com>

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants