docker-jottacloud icon indicating copy to clipboard operation
docker-jottacloud copied to clipboard

Make latest image auto-update

Open NorskNoobing opened this issue 11 months ago • 6 comments

I'm interested in this project, but I'd want jotta-cli and dependencies to automatically update. This should likely be in the :latest image, and other versions of the docker image could be pinned to jotta-cli versions, like i.e. :0.16.126924. I've come up with a couple of different ways to get this done, but I'm unsure of which way that would be best.

  1. Build the image like you currently do, and add an apt-get update && apt-get upgrade -y to the entrypoint.sh. This makes it so the default image uses an old version of jotta-cli, but then upgrades at boot, which seems like a weird implementation to me but probably the easiest.
  2. Move both the dependency and jotta-cli download steps from the build process over to the entrypoint.sh, so jotta-cli gets re-downloaded every time you start the container. This would probably affect the boot times of the container, but I don't think it would be that bad.
  3. Create a GitHub action to check for a new jotta-cli version, then bump the version, build the image, and push it to docker.io. This would probably be the best implementation, and I know that it would work, because I'm currently running a GitHub action to push one of my images to dockerhub.

Any input would be greatly appreciated :)

NorskNoobing avatar Feb 01 '25 22:02 NorskNoobing

Connected to Huly®: GHALL-312

huly-for-github[bot] avatar Feb 01 '25 22:02 huly-for-github[bot]

Hi @NorskNoobing, thanks for the suggestions. This has been in my mind for a long time, but I haven't done it yet.

From the versioning/version control perspective, I dropped options 1. and 2. a long time ago. 3. is the right way to do it.

As jotta-cli does not release its updates using GitHub or other public VCS, we must find a way to monitor it.

Any thoughts? Would you like to help on this by sending a PR? 😃

bluet avatar Feb 03 '25 07:02 bluet

I can take a look. It would probably involve spinning up a VM through actions, then checking the version number string through the apt command. Any thoughts on where we can get the old/current version number from?

I'd want to compare the current jotta-cli version of the docker image, with the version that you get from the apt command. If the apt command shows a version that is higher than the current version, then it should automatically build the image and publish it using the new version.

NorskNoobing avatar Feb 03 '25 11:02 NorskNoobing

@NorskNoobing how about we move the version setting into a settings file or env file, and let Dockerfile and docker-build.sh to import it during the build process? (And ship the file with the result docker image) So you can check that file content to know current version info.

About the VM part: a Ubuntu container can do the same thing I think?

bluet avatar Feb 03 '25 12:02 bluet

how about we move the version setting into a settings file or env file, and let Dockerfile and docker-build.sh to import it during the build process? (And ship the file with the result docker image) So you can check that file content to know current version info.

That would probably work fine. I would assume that the env file should be the same format as a docker/bash/shell .env file? Something like build.env?

About the VM part: a Ubuntu container can do the same thing I think?

Yep, that’s what I was thinking, but couldn't find the right wording. Just replace VM with ubuntu container :)

NorskNoobing avatar Feb 03 '25 13:02 NorskNoobing

I would assume that the env file should be the same format as a docker/bash/shell .env file? Something like build.env?

Yes, just a regular env file with content like this 👍

JOTTA_VERSION=0.1.2-3

bluet avatar Feb 03 '25 14:02 bluet