abbbi / virtnbdbackup

Backup utility for Libvirt / qemu / kvm supporting incremental and differential backups + instant recovery (agentless).
http://libvirtbackup.grinser.de/
GNU General Public License v3.0
338 stars 46 forks source link

Support for GitHub Container Registry #179

Closed gaby closed 6 months ago

gaby commented 6 months ago

This workflow creates the following tags:

abbbi commented 6 months ago

hi,

thanks, not being familiar with release on gihub registry, but whats the issue here? Seems this will only work if a propper tag is pushed?

provenance mode=max,builder-id=https://github.com/abbbi/virtnbdbackup/actions/runs/8912936010 --tag ghcr.io/abbbi/virtnbdbackup/:master --metadata-file /home/runner/work/_temp/docker-actions-toolkit-fsVHHF/metadata-file --push docker/
ERROR: invalid tag "ghcr.io/abbbi/virtnbdbackup/:master": invalid reference format
Error: buildx failed with: ERROR: invalid tag "ghcr.io/abbbi/virtnbdbackup/:master": invalid reference format

guess this needs something like:

${{ env.IMAGE }}:master

?

abbbi commented 6 months ago

got it sorted. Thanks.

gaby commented 6 months ago

@abbbi Seems like I forgot to remove the trailing slash when copy pasting the repo url 😂

gaby commented 6 months ago

Here:

        with:
          images: |
            ghcr.io/abbbi/virtnbdbackup/

^ That trailing slash was the error

gaby commented 6 months ago

@abbbi You need to make packaged public in this repo to be able to download them. https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility#configuring-visibility-of-packages-for-your-personal-account

The image will be ghcr.io/abbbi/virtnbdbackup:master until a release is done, then it will get semver tagged.

abbbi commented 6 months ago

hi,

yes, the package options are set to public. The relase is working now, but for some reason the image published on ghcr.io does not include the latest master checkout but seems to default to the latest relased version:

docker run -it  ghcr.io/abbbi/virtnbdbackup:master virtnbdbackup -V
2.9

even tho i have raised the version and the publish went smooth:

https://github.com/abbbi/virtnbdbackup/actions/runs/8913997543

the only thing i noticed in the publish logs is the following message:

https://github.com/abbbi/virtnbdbackup/actions/runs/8913997543/job/24480654980#step:7:152

which is suspicious ..

The docker build checks out the latest master version and installs it:

https://github.com/abbbi/virtnbdbackup/actions/runs/8913997543/job/24480654980#step:7:350

so im wondering whats going on there ..

abbbi commented 6 months ago

OK, it seems this was caused by the caching options. I removed them and now it publishes the latest version:

docker run -it  ghcr.io/abbbi/virtnbdbackup:master virtnbdbackup -V
2.10

but it think for all stuff to work correctly (with versioned builds) the dockerfile needs ot be improved to checkout the tag:

https://github.com/abbbi/virtnbdbackup/blob/master/docker/Dockerfile#L20

gaby commented 6 months ago

@abbbi Yeah I noticed that. I can make another PR to update the Dockerfile later.

Support for building the image during PR's can also be added (without publishing it).

abbbi commented 6 months ago

should be fixed by:

https://github.com/abbbi/virtnbdbackup/commit/aa34e3fd3f907296f1f221aef282f9ede19e87f0

gaby commented 5 months ago

@abbbi The tags from the repo are not valid semver (missing patch) which is why the CI failed. The three lines in the docker metadata about semver would need to be removed.

abbbi commented 5 months ago

@gaby thanks, seems to work now!