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

Store images and video outside the docker container #14

Closed AdySan closed 5 years ago

AdySan commented 5 years ago

This should be obvious but I couldn't find this in the documentation. I'm a Docker noob, so forgive me if this is a trivial question. By default the images captured are saved to /etc/opt/kerberosio/capture/, how do I save them to an drive outside the docker container?

ghost commented 5 years ago

I am trying to do the same but fail so when using:

docker run \ ... --volume /mnt/data/kerberosio/garagecam/capture:/etc/opt/kerberosio/capture \ --volume /mnt/data/kerberosio/garagecam/config:/etc/opt/kerberosio/config \ --volume /mnt/data/kerberosio/garagecam/logs:/etc/opt/kerberosio/logs \ --volume /mnt/data/kerberosio/garagecam/web/config:/var/www/web/config \ ...

The log file is written but even after copying the config files from another instance I can't get it to work :(

Any suggestions?

cedricve commented 5 years ago

Hey you could use our dockeros (see readme https://github.com/kerberos-io/docker)

Internally (inside dockeros) we create containers with a seperate config volume as following: https://github.com/kerberos-io/docker/blob/master/bin/src/docker.sh#L43

roben commented 5 years ago

Thanks for the help. Would you mind adding a pass through functionality for docker parameters? For example

./dockeros.sh create {name} {config} {webport} {streamport} {dockerparams}

This way we could just add the additional mount points to the create command.

cedricve commented 5 years ago

yeah make sense thanks @roben

AdySan commented 5 years ago

FWIW, I got this owrking with this command

docker run --name kerberos1 -p 8089:80 -p 8889:8889 -v /media/usb/hd1/kerberos/kerberos1:/etc/opt/kerberosio/capture/ -d kerberos/kerberos 
drthanwho commented 4 years ago

FWIW, I got this owrking with this command

docker run --name kerberos1 -p 8089:80 -p 8889:8889 -v /media/usb/hd1/kerberos/kerberos1:/etc/opt/kerberosio/capture/ -d kerberos/kerberos 

I tried doing the same with your command but frontend won't load now.

sudo docker run --name eisodos2 -p 8080:80 -p 8889:8889 -v /mnt/usb/CCTV:/etc/opt/kerberosio/capture/ -d kerberos/kerberos

image

cedricve commented 4 years ago

FWIW, I got this owrking with this command

docker run --name kerberos1 -p 8089:80 -p 8889:8889 -v /media/usb/hd1/kerberos/kerberos1:/etc/opt/kerberosio/capture/ -d kerberos/kerberos 

I tried doing the same with your command but frontend won't load now.

sudo docker run --name eisodos2 -p 8080:80 -p 8889:8889 -v /mnt/usb/CCTV:/etc/opt/kerberosio/capture/ -d kerberos/kerberos

image

looks like the second mount already contains files, the mounted folder should be empty, or only contain valid image/video files.

drthanwho commented 4 years ago

looks like the second mount already contains files, the mounted folder should be empty, or only contain valid image/video files.

That would explain it since the folder I tried mounting isn't empty. Will try again with an empty folder and see how that goes

drthanwho commented 4 years ago

So using the command from @AdySan it worker really well once I fixed the issue I mentioned above. However the HDD I had mounted died so now that I've replaced it the mount directory has changed and is no longer recognised on Kerberos.

I'm not as familiar with docker yet. Is it possible to just change this to reflect the new mount point without having to delete the container and start all over again?

cedricve commented 4 years ago

Interesting! I have actually no idea. Someone in this thread who knows the answer right away? I will check it out myself as well. Keep you posted.

Kind regards, Verstraeten Cédric

On 9 Apr 2020, at 01:54, Thanasis notifications@github.com wrote:

 So using the command from @AdySan it worker really well once I fixed the issue I mentioned above. However the HDD I had mounted died so now that I've replaced it the mount directory has changed and is no longer recognised on Kerberos.

I'm not as familiar with docker yet. Is it possible to just change this to reflect the new mount point without having to delete the container and start all over again?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

drthanwho commented 4 years ago

Thanks a lot!

Had a look on volumes and binds info online, people were saying you could go into the docker container's json files and simply edit the directory to the one you want and simply start container again. But it seems that they get overridden when it starts up.