Hallo Felix,
On 24.08.22 14:55, Aldenburg, Felix wrote:
> Hello,
>
> we would like to install docker images with swupdate.
>
Ok
> These images are later used by our application. (You can think of it as
> a app manager similar to ones on smartphones, but using docker
> images/container.)
This is already a known pattern, I have done this, too.
>
> These docker images may potential be quite large size, and we have
> limited disk space so we’d like to import them directly into the docker
> engine without having to store them temporarily.
This seems difficult - I switched to podman as replacement for docker,
more or less due to the critics about docker (and I had several cases
where docker daemon did not run). However, it seems to me (and as far as
I remember, this what reported by someone else in the list), that
"podman load" first copies the tarball before creating the image, and
this vanifies the streaming feature in SWUpdate. But it was not so
critical in those projects of mine, and I have not investigated further.
Just remark this if you have different experiences.
>
> As a POC, we did some testing with a custom lua and c handler, where we
> streamed the docker image from the .swu file into the docker shell cli tool.
>
> lua_docker_handler.lua
>
> require ("swupdate")
>
> install_docker_image = function(image)
>
> swupdate.trace("Lua docker handler started")
>
> local dockerhandle = io.popen("docker load", "w")
>
> err, msg = image:read(function(data)dockerhandle:write(data) end)
>
> if err ~= 0 then
>
> swupdate.error(string.format("Error: %s", msg))
>
> dockerhandle:close()
>
> return 1
>
> end
>
> dockerhandle:close()
>
> swupdate.trace("Lua docker handler end")
>
> return 0
>
> end
>
> swupdate.register_handler("lua_docker_handler", install_docker_image,
> swupdate.HANDLER_MASK.IMAGE_HANDLER)
>
> While our POC works, we are wondering if there are better ways to
> utilize swupdate to action this task.
IMHO the tarball is copied temporarily in the example above - are you
sure there is no additional copy ? Have you monitored /tmp and
/tmp/datadst during the update ? I am expecting that the tarball is
saved temporarily.
>
> Or perhaps this totally out of scope for swupdate?
No, it is not. It can be very interesting to add it to SWUpdate. I added
up now containers' images in some projects with a Lua / shell script,
but there was not strict requirement about space and customer won't
finance a "container handler".
>
> Would a docker image import handler be an interesting asset for the
> swupdate project?
Definetly, supporting both docker and podman. The REST-API is compatible
and the only difference is that a podman service should be started
before the update - my idea was to start the service from the handler
when a container image must be installed.
>
> Looking forward to receiving your feedback and thoughts on the topic.
Best regards,
Stefano Babic
>
> Best regards
> Felix Aldenburg
>
> ------------------------------------------------------------------------
> Kommanditgesellschaft - Sitz: Detmold - Amtsgericht Lemgo HRA 2790 -
> Komplementärin: Weidmüller Interface Führungsgesellschaft mbH -
> Sitz: Detmold - Amtsgericht Lemgo HRB 3924;
> Geschäftsführer: Dr. Timo Berger, Volker Bibelhausen, André Sombecki;
> USt-ID-Nr. DE124599660
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swupdate+u...@googlegroups.com
> <mailto:
swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/swupdate/DU0PR08MB763851784BF8BA1523CC8A13F0739%40DU0PR08MB7638.eurprd08.prod.outlook.com
> <
https://groups.google.com/d/msgid/swupdate/DU0PR08MB763851784BF8BA1523CC8A13F0739%40DU0PR08MB7638.eurprd08.prod.outlook.com?utm_medium=email&utm_source=footer>.
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================