oetiker / znapzend

zfs backup with remote capabilities and mbuffer integration.
www.znapzend.org
GNU General Public License v3.0
607 stars 137 forks source link

Add Docker Container #471

Closed ccremer closed 4 years ago

ccremer commented 4 years ago

Hello! Thanks for this awesome ZFS management tool! I would like to run znapzend packaged in a (docker) container support

What this PR does

It adds

The master container tag on Docker Hub is similar to latest, but I often find latest ambiguous, as it's never clear whether "latest" means "latest (dev) build" or "latest stable", or whatever. With master it's clear that it corresponds to the master branch.

Please let me know if there are more dependencies (other than ZFS, mbuffer) needed in the container runtime image.

Why this PR is needed

Currently, the container needs to run privileged. I haven't invested the time to investigate why or if it can run unprivileged. The configuration store in ZFS properties comes handy, it removes the need to mount a config file.

What else needs to be done

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 91.649% when pulling 338527cd4d356c4cac4f1bedf84b7a3247d9be6c on ccremer:container into 62b10796af1535eca2430abc7ec8115e8c6b7141 on oetiker:master.

ccremer commented 4 years ago

how about pushing the docker image to the new github package repo and switching to using github actions for building the whole thing while at it ?

Switching to Github Actions is also my preferred solution, it's faster, better documented and more consistent. I wasn't sure how attached you were to Travis.

I have tried Github package repo once, I recall some limitation but I need to check what that was... let me try again.

running the automated tests with the docker image would be a good thing to veryfy that it is working ...

We could introduce another build stage after the runtime stage (FROM builder as test) and run the unit tests in the buster image. For master branch and tagged releases we can then only build the runtime image with the docker build -t ... --target runtime command.

ccremer commented 4 years ago

Now I know the limitation:

$ docker pull docker.pkg.github.com/ccremer/znapzend/znapzend:master
Error response from daemon: Get https://docker.pkg.github.com/v2/ccremer/znapzend/znapzend/manifests/master: no basic auth credentials

It's not publicly available without a login :( Also, apparently the downloads costs: https://github.com/settings/billing. So I still recommend Docker Hub.

I have now migrated to GitHub actions and also included the tests in the Docker build. Re-added the matrix build with the different Perl versions, but I know that 5.16 definitely fails, so I left that out.

I'm also not sure anymore if Coveralls becomes broken, I had to create a .coveralls.yml in the CI job. Now it passes with a warning, but hopefully that's just because I haven't set up coveralls for this forked repo.

oetiker commented 4 years ago

cool!

oetiker commented 4 years ago

guess I'll have to merge to see if it wall works :) give me a few days