Make latest image auto-update
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.
- Build the image like you currently do, and add an
apt-get update && apt-get upgrade -yto theentrypoint.sh. This makes it so the default image uses an old version ofjotta-cli, but then upgrades at boot, which seems like a weird implementation to me but probably the easiest. - Move both the dependency and
jotta-clidownload steps from the build process over to theentrypoint.sh, sojotta-cligets 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. - Create a GitHub action to check for a new
jotta-cliversion, 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 :)
Connected to Huly®: GHALL-312
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? 😃
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 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?
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 :)
I would assume that the env file should be the same format as a docker/bash/shell
.envfile? Something likebuild.env?
Yes, just a regular env file with content like this 👍
JOTTA_VERSION=0.1.2-3