kerberos-io / kerberos-docker

Run Kerberos Open Source inside a docker container.
http://doc.kerberos.io/opensource/installation#docker
103 stars 31 forks source link

Volumes not mapping properly #22

Closed rkoktan closed 4 years ago

rkoktan commented 4 years ago

I am using the following, but the mappings do not work correctly...

docker run -d --name kerberos-camera1 -p 8859:80 -p 8860:8889 -v /cameras/config:/etc/opt/kerberosio/config -v /cameras/capture:/etc/opt/kerberosio/capture -v /cameras/logs:/etc/opt/kerberosio/logs kerberos/kerberos

...and while the web interface loads correctly, it returns...

Oops, something went wrong One or more config files are missing in /etc/opt/kerberosio/config. Please check if the .xml files are available.

I tried the dockeros as suggested but could not figure the mappings out there either. I'd prefer to use the above command, can you tell me what the proper syntax is?

cedricve commented 4 years ago

do you have the correct config files in /cameras/config?

rkoktan commented 4 years ago

I've created the config folder (as well as capture and logs folders) under /cameras/ and expected the config files to be created in that location upon first running the image and going thru the web configuration, but it does not get the that point as I mentioned in my first post. Interestingly, the logs do get created and populated in the location I specify. If I simply run...

docker run -d --name kerberos-camera1 -h optiplex.livingsky.ca -p 8859:80 -p 8860:8889 --restart=unless-stopped kerberos/kerberos

... all the expected XMl config files are created inside the docker container under /etc/opt/kerberosio/config, but I need them to be persistent and be stored in the mapped folder.

maui1911 commented 4 years ago

I have this same problem. If you map the volumes the config files are not created. I think it expects already created config files. But I have a fresh install and I want the defaults to be created if they don't exist yet.

this is wat i run: docker run -d \ --name backyard_cam \ --restart=unless-stopped \ -p 81:80 \ -p 58889:8889 \ -v /storage/cams/backyard_cam/:/etc/opt/kerberosio/capture \ -v ~/kerberos/backyard_cam/web/config:/var/www/web/config \ -v ~/kerberos/backyard_cam/config:/etc/opt/kerberosio/config \ -v ~/kerberos/backyard_cam/logs:/etc/opt/kerberosio/logs \ --device /dev/dri:/dev/dri \ kerberos/kerberos:latest

cedricve commented 4 years ago

Hey @maui1911, yes correct it expects the configuration files are already present. However what you suggest makes a lot of sense. The machinery should check if the files exists, and if not create the them based on a template.

We are currently focusing on Kerberos Enterprise, but come back to the open source version asap.

Cédric

cedricve commented 4 years ago

We will provide a fix in the upcoming days, short term.

cedricve commented 4 years ago

We have added a fix, and are rebuilding the docker image.

rkoktan commented 4 years ago

Okay, the mapping appears to work correctly now, as when I shut down the container the config files, logs and captured images and videos remain in the mapped folders I set up. However, when I restart the container and go to the login URL, it refuses my credentials. If I go to the welcome URL and re-enter my credentials, it then logs on fine and my configuration is still present and working and the dashboard populates normally.

cedricve commented 4 years ago

Thanks, you should also map the Web folder. There is some data persisted to check if you already passed the welcome setup.

https://github.com/kerberos-io/docker/blob/master/Dockerfile#L177 https://github.com/kerberos-io/docker/blob/master/Dockerfile#L177

On 21 Apr 2020, at 19:48, rkoktan notifications@github.com wrote:

Okay, the mapping appears to work correctly now, as when I shut down the container the config files, logs and captured images and videos remain in the mapped folders I set up. However, when I restart the container and go to the login URL, it refuses my credentials. If I go to the welcome URL and re-enter my credentials, it then logs on fine and my configuration is still present and working and the dashboard populates normally.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/kerberos-io/docker/issues/22#issuecomment-617314922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALZUG3L7VRATF4ZSJ2OPJLRNXL6ZANCNFSM4KD4CVSA.

rkoktan commented 4 years ago

Once I added the web folder to the mappings, it all works perfectly now... thank you so much for your effort!

cedricve commented 4 years ago

Fixed ;) thanks for the help @rkoktan