Skip to content

How to set uid/gid in docker compose file with rootless? #305

Closed Answered by CorentinTh
adoyle-h asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @adoyle-h

To set the UID and GID correctly in a rootless Docker container, you can specify them directly in your docker-compose.yml file by using the user property. Update your docker-compose.yml like this:

services:
  enclosed:
    image: corentinth/enclosed:latest-rootless
    ports:
      - 8787:8787
    volumes:
      - ./enclosed-data:/app/.data
    restart: unless-stopped
    user: "1000:1000"  # Set UID and GID here

Also make sure the enclosed-data directory on your host has permissions that match UID 1000 and GID 1000. You can update the permissions with:

sudo chown -R 1000:1000 ./enclosed-data

Let me know if this resolves the issue or if you encounter any other problems

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CorentinTh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants