I have started finding myself more comfortable with LXD than docker. Earlier, I was able to convert any iso file to docker image by following commands:
I was trying to have lxd image of coreOS as an experiment.
I find this method more easy to create image. When we can create a docker image from squashfs-tools then we should also able to create lxd image.
Thanks Toby, I tried it with tar.xz and tar.gz but no success in building lxd image. Error: Could not extract image metadata.yaml from tar: Failed to run: tar -O -xf /var/lib/lxd/images/lxd_build_600179762/lxd_post_378730985 metadata.yaml: tar: metadata.yaml: Not found in archive
Thats what I meant with replicate:
distrobuilder seems to add some files, like “metadata.yaml”, so you would have to create/modify and add that by hand.
But honestly what is the purpose, you can just download or create lots of distro images.
You can also modify the templates used by distrobuilder: https://github.com/lxc/lxc-ci/tree/master/images
to add software etc.
And you can create an image from a container, so this way you can save and reuse all the modifications from it.
Note: This applies only to existing templates or images, if you want to setup an unsupported Operating System you at least need to combine this with other methods (like template modification so it fits the new OS etc.).
An Alternative would be the other way around, take a look at an iso (open it) and find out what programs are installed in it for example, and then include that in a template for the distrobuilder or in the cloud-init config that can run on container start, so the resulting image or container, contains all the software the .iso includes.
okay I will check this An Alternative would be the other way around, take a look at an iso (open it) and find out what programs are installed in it for example, and then include that in a template for the distrobuilder or in the cloud-init config that can run on container start, so the resulting image or container, contains all the software the .iso includes.
My Argument is When we can create a docker image from squashfs-tools then we should also able to create lxd image.
One more approach, you could look at the templates:
And take the template that is most similar to CoreOS (I don’t know about CoreOS so I can’t give you an advice about that; maybe CoreOS is so different that none fits) and try to modify it so it fits for CoreOS.
And then build the new template with distrobuilder.
Maybe someone else tried the same thing already, so a search in the net might bring helpful advice.
My Argument is When we can create a docker image from squashfs-tools then we should also able to create lxd image.
Hmm I don’t know about that , but I agree that building an image by hand would be a good thing, then again there is a reason for the distrobuilder, so it seems to be a bit more complicated.
Update:
Just found this:
Might be easier to setup (for example with the template modification mentioned above), but I don’t have a clue .
Some more ideas:
If CoreOS can be run inside Docker you might find a converter to convert the necessary Dockerfile etc. into LXD (though that maybe does not solve the image problem…)
Interestingly the website seems to only recommend set up in virtual machines or on servers/computers directly…
If you use a virtual machine, that might be much easier.