lorserker/ben

create container image in ghcr.io for easy deployment using github actions

larrycai opened this issue · 7 comments

Description

Most of the opensource project now provides container (docker) image for easy deployment, as stated in #70, it saves the time to prepare the environment. (podman is another popular container engine)�

$ podman run -it -p 8080:8080 -p 4443:4443 lorserker/ben

then http://localhost:8080

Technical

we just need to tag (or branch) to trigger the auto build and publish, so it has version on

  • lorserker/ben -> lorserker/ben:latest
  • lorserker/ben:0.1.0 -> version 0.1.0 using git tag 0.1.0

FAQ

  • why not use docker hub?
    • they have download limits, ghcr.io is more popular now
  • can docker/podman and kubernetes use this container image?
    • Yes, it is standard container image.
  • does it support for windows & mac besides linux
    • default is x86/linux, for other platform, it is different format, may needs extra efforts ($)
  • docker vs podman
    • they are both container engine, almost the same for our case.

so far it is https://github.com/larrycai/ben/blob/main/.github/workflows/docker-image.yml (generate ghcr.io/larrycai/ben:release) , triggered on branch, needs to change to tag. After that, I will create PR for it.

Nice work. Looking forward to the PR

Please add information about how to stop the container, when no longer needed.

Oops, after a while, I noticed it was quite expensive for ghcr.io (our container image will be 3G at least)

need switch to https://hub.docker.com/ (then it has account issue again)

  • larrycai/ben
  • lorserker/ben ( i can maintain it)
  • <any org>/ben
  • ..

pause it for a while

seems free for opensource porject

GitHub Packages usage is free for public packages

https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry

Nice, it works like below, triggered by tag (schema is vx.x.x )

Release: https://github.com/larrycai/ben/releases

image

Then the related container image has correct tag as well (only apply latest to released version)

Package: https://github.com/larrycai/ben/pkgs/container/ben

image

looks perfect !