Updating docker instance via docker compose fails

Hi! šŸ‘‹

I'm having a problem with docker instance of SiYuan. I'm hosting on my RPi4 with Ubuntu 22.04.5 LTS using docker compose.

I decided to upgrade my SiYuan 3.1.7 to the latest image. I used docker compose down, then removed the container and image, then used docker compose up -d. It pulled images, built the container alright, but when it starts, the following message is looped and it restarts constantly:

Attaching to main-1
main-1  | Creating group siyuan (1000)
main-1  | addgroup: permission denied (are you root?)
main-1 exited with code 0
main-1  | Creating group siyuan (1000)
main-1  | addgroup: permission denied (are you root?)
main-1  | Creating group siyuan (1000)
main-1  | addgroup: permission denied (are you root?)
main-1  | Creating group siyuan (1000)
main-1  | addgroup: permission denied (are you root?)
main-1  | Creating group siyuan (1000)
main-1  | addgroup: permission denied (are you root?)

I used suggestions on How do I properly update SiYuan on Docker? and Setting up siyuan with docker and exposing it with cloudflare to make it run. The docker-compose.yml file is mostly default and looks like this:


version: "3.9"
services:
  main:
    image: b3log/siyuan
    command: ['--workspace=/siyuan/workspace/', '--accessAuthCode=notMyRealAccesCode']
    user: '1000:1000'
    ports:
      - 6806:6806
      - 6808:6808
    volumes:
      - /siyuan/workspace:/siyuan/workspace
    restart: unless-stopped
    environment:
      - TZ=CET

The workspace folder is owned by the user with UID 1000 and group 1000

> ls -la /
drwxr-xr-x   3 ubuntu ubuntu  4096 Sep 24 07:40 siyuan
> cd siyuan
> ls -la
drwxr-xr-x  6 ubuntu ubuntu 4096 Nov  6 10:50 workspace
> cd workspace
> ls -la
drwxr-xr-x   6 ubuntu ubuntu  4096 Nov  6 10:50 .
drwxr-xr-x   3 ubuntu ubuntu  4096 Sep 24 07:40 ..
drwxr-xr-x   3 ubuntu ubuntu  4096 Nov  6 10:30 conf
drwxr-xr-x  17 ubuntu ubuntu  4096 Sep 24 09:19 data
drwxr-xr-x 651 ubuntu ubuntu 36864 Nov  6 10:30 history
drwxr-xr-x   2 ubuntu ubuntu  4096 Nov  6 10:50 temp


And cat /etc/passwd reveals that ubuntu user is indeed number 1000

ubuntu:x:1000:1000:Ubuntu:/home/ubuntu:/bin/bash

I am at a loss and have no idea how to proceed. Can anyone help me out?

Thanks in advance.

    Related articles

    Welcome to here!

    Here we can learn from each other how to use SiYuan, give feedback and suggestions, and build SiYuan together.

    Signup About
    Please input reply content ...
    • Eric ā€¢
      Author

      PS: I tried running with sudo - same thing.

    • Eric ā€¢
      Author

      PS2: I also tried running it with docker run command. Also, same thing.

    • 88250 ā€¢

      Please refer to the project's README Docker section for instructions.

    • Eric ā€¢
      Author

      tl;dr

      I removed the line user:"1000:1000" and it worked.


      Thank you 88250 for the answer, though very vague and did not explain anything except what I already knew - that what I'm doing does not work. Simply writing "concept changed, remove this line" would save me a few hours of debugging.

      For others that may run in a similar problem in the future:

      Apparently, the build process changed a little bit. It seems to be reflected in the documentation at

      you avoid the need to explicitly set the user directive (user: '1000:1000') in the compose file

      "avoid the need to explicitly set" means to me that it is optional and when given it will be taken into consideration. Whereas the 'user' directive seems to be now completetly skipped, or misused (perhaps the format is wrong?) and the PUID and PGID are taken into account. My user and group are default, hence I don't have to add those values in the environment section.

      Problem solved.