Closed xmonader closed 1 month ago
let's see if we can do a docker subcommand if possible to register it, but if not let's go with a separate tool
p.s: https://www.youtube.com/watch?v=78IMA8xEBHA i didn't watch that, but maybe it gives a better option for docker integration
The tool is created, and it generated flists successfully from docker images. I noticed it takes a long time to pack an flist.
The tool is ready to be reviewed
WIP: working on the HTTP server of flists conversion, list and get
First i suggest that the name should be
docker2fl
ordocker2fungi
, to not be confused with the olderflist
format.The tool goal is to make it easier to build
fl
files from any docker image. IMHO the tool can be written in rust, this way it can very easily import and use therfs
library directly to create the fl, otherwise you will have to relay and use an externalrfs
binary to do so.In general the process of the conversion has to go like this
docker save
command this saves the image to a.tar
file.directory
that contains the extracted files here. Of course the tool can easily implement this itself, and not use the script 🤷🏼♂️rfs
tool can be used topack
the directory creating the fl. Again i think it's really better to embedrfs
library in the tool itself, (hence build the full thing in rust). Check first the rfs command line to see how to use @Omarabdul3ziz can help with that one. And I of course if u have questionsThat is "almost" it.
But, there is an
undocumented
feature that is done by the current hub docker2flist. Since docker image also has meta about, entrypoint and env. which is not natively supported by the fl format (since the fl/flist format are mainly implementing the filesystem layer). The hub on conversion creates an extra file at the root of the directory before packing called.startup.toml
this file is only used by zos if you going to run a workload. This file defines the default entrypoint and default env. The entrypoint can then be overridden by the deploymententrypoint
if needed. The 2 envs (from the flist, and from the deployment) are merged.Sample content of the file
All toml entry names must be preserved. All the values that u need to set are values under
startup.entry.args
andstartup.entry.args.env
.