scottlamb / moonfire-nvr

Moonfire NVR, a security camera network video recorder
Other
1.18k stars 138 forks source link

Issue installing in docker #296

Closed deanfourie1 closed 7 months ago

deanfourie1 commented 7 months ago

Describe the bug Unable to start docker container.

Also, when atempting to edit moonfire-nvr.toml

sudo nano /etc/moonfire-nvr.toml [ "/etc/moonfire-nvr.toml" is a directory ]

I cannot edit the file as it says its a directory. The documentary clearly states to edit the config file @ /etc/moonfire-nvr.toml.

Error: Error response from daemon: unable to find user UID: no matching entries in passwd file

To Reproduce Steps to reproduce the behavior:

  1. Install Docker
  2. Run docker container from docker-compose.yml file
  3. docker compose up

Expected behavior Container to run.

Screenshots

Server (please complete the following information):

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

scottlamb commented 7 months ago

[ "/etc/moonfire-nvr.toml" is a directory ]

Are you running this from inside the Docker container? The idea is you mount this file from the host filesystem, after creating it there. Then the /etc/moonfire-nvr.toml:/etc/moonfire-nvr.toml:ro mount will work.

Error response from daemon: unable to find user UID: no matching entries in passwd file

You have to follow the instructions in the comment, replacing UID and GID with the actual and gid:

    # Edit this to match your `moonfire-nvr` user (see `useradd` command in
    # install instructions).
    user: UID:GID
scottlamb commented 7 months ago

Just wanted to say: sorry if my terse response above came off as rude. For context, I'm struggling to find time to work on Moonfire, and I was reluctant to even have a Docker option in the install instructions for fear of confusion (see here). I'm a bit frustrated to see that seems to be the case.

If you have any ideas to improve the instructions, PRs are welcome...

fakuivan commented 7 months ago

As @scottlamb mentioned, you need to first create the config file you're trying to pass onto the container. The default behaviour for docker is to:

  1. Look for the file on the host file system
  2. If found, mount it, being a directory or a file
  3. If not found, mount it as a directory

If the file /etc/moonfire-nvr.toml does not exist on the host, then docker will create a directory with that name, despite it having the .toml extension. As far as I can see this has been adressed in the docs so I think we're ok.