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

Define user when using docker compose #4377

Closed
2 tasks done
Feriman22 opened this issue Jan 16, 2024 · 5 comments
Closed
2 tasks done

Define user when using docker compose #4377

Feriman22 opened this issue Jan 16, 2024 · 5 comments
Labels
area:deployment related to how uptime kuma can be deployed help Stale

Comments

@Feriman22
Copy link

⚠️ Please verify that this question has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

I'd like to run Uptime Kuma with a different user in Docker, because currently it's running as root.
How can I define it here?

Example:

    environment:
      - USER_ID=1006
      - GROUP_ID=996

Thanks!

📝 Error Message(s) or Log

No response

🐻 Uptime-Kuma Version

1.23.11

💻 Operating System and Arch

Debian 10.12

🌐 Browser

Google Chrome 120

🐋 Docker Version

No response

🟩 NodeJS Version

No response

@Feriman22 Feriman22 added the help label Jan 16, 2024
@CommanderStorm
Copy link
Collaborator

See https://github.com/louislam/uptime-kuma/wiki/Environment-Variables#docker-specific-environment-variables
You could use the standard PUID/PGID. I have not tested if they work.

v2 will come with full support of running as another user via the -rootless tags. See #4052 for further context.
See #4171 for what bugfixes still need to happen until a first beta can be issued.

@CommanderStorm CommanderStorm added the area:deployment related to how uptime kuma can be deployed label Jan 17, 2024
@Feriman22
Copy link
Author

Hmm, that's strange... The document says that the default PUID and GUID are 1000, but when I set these values:

    environment:
      - PUID=1000
      - PGID=1000

in a docker compose, the Uptime Kuma cannot check the container status. Any idea why?

image

@CommanderStorm
Copy link
Collaborator

cannot check the container status

How have you mounted the docker socket?
What are the permissions of said socket?
Can the chosen PUID/PGID access said socket?

@Feriman22
Copy link
Author

You can find my docker compose below. I have added it as read only, due to the checking doesn't require a write permission.

srw-rw---- 1 root docker 0 Jan 14 12:14 /var/run/docker.sock

The user with PIUD 1000 is part of the docker group, so it has an access to it.

version: '3.8'

services:
  uptime-kuma:
    image: louislam/uptime-kuma:alpine
    container_name: uptime-kuma
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /mnt/Docker/uptime-kuma:/app/data
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 3001:3001
    restart: always
    network_mode: bridge
    cpus: 0.5
    mem_limit: 400M

Copy link

We are clearing up our old help-issues and your issue has been open for 60 days with no activity.
If no comment is made and the stale label is not removed, this issue will be closed in 7 days.

@github-actions github-actions bot added the Stale label Mar 17, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:deployment related to how uptime kuma can be deployed help Stale
Projects
None yet
Development

No branches or pull requests

2 participants