After some time not having update this blog, with the opportunity of a new release it is a good time to expose what is going on with the project. SWUpdate has got its regular releases on 6 months base, and new release add new features to simplify the update of the containers. Up now, containers update was supported, but loading new images and managing of containers had to be done outside SWUpdate by using own scripts. In 2023.12, the REST-API of docker, corresponding to version 1.43 of the API, is implemented with native handlers. The logic inside is that containers are part of the SWU, letting to upgrade main OS and application containers with a single file and with a single source without using external hub for images.
The core of the docker support is to load a new image. Standard SWUpdate’s features are supported as well, and images for containers can be installed in streaming mode like the other artifacts. The loader docker image is an image handler, and an example for its usage can be:
images: ({
filename = “docker-image.tar”
type = “docker_imageload”;
installed-directly = true; // if you need streaming
})
As well as for loading, there are a set of handlers to manage images. All of them are realized as script handler, and they runs as postinstall script. Images can be deleted and “prune” to remove old images.
Container can be created with the own handler. In that case, the artifact passed to the handler is the JSON file interpreted by docker to configure the container. For example, to create a “Hello World” container, the configuration can be something like:
{
“Image”: “hello-world”,
“HostConfig”: {
“RestartPolicy”: {
“Name”: “always”
},
“AutoRemove”: false
}
}
This file should be packed into the SWU. In sw-description, the handler to install the JSON above looks like:
scripts: ( {
filename = “hello-world.json”;
type = “docker_containercreate”;
properties: {
name = “helloworld”; /* Name of container */
}
});
Further handlers allow to delete and prune containers. Not the full REST-API is implemented, but just the entry points required for an update. Next, further API could be added, as to manage networks and volumes.
New release does not just have news related to containers. There is support for application variables, that allow to split and to set persistent values without using bootloader variables and without using files for this. Of course, writing application variables are fully power-cut safe and redundant like the bootloader variables.
Delta update can run over encrypted channels, like other communication. Better support for wfx backend is introduced. And of course, a set of fixes flew into mainline – you can check what was changed and fixed by reading the git history of the project.