Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

investigate how to use LXD images #54

Open
ncopa opened this issue Oct 25, 2023 · 4 comments
Open

investigate how to use LXD images #54

ncopa opened this issue Oct 25, 2023 · 4 comments

Comments

@ncopa
Copy link
Contributor

ncopa commented Oct 25, 2023

LXD maintains a lot of OS OCI images. It would be nice to be able to pull OS images from LXD. Needs investigation on how we can do this.

@kke
Copy link
Contributor

kke commented Oct 25, 2023

I was able to extract the qcow2 from https://jenkins.linuxcontainers.org/view/Images/job/image-alpine/lastBuild/architecture=amd64,release=3.18,variant=default/ - I put it into disk.tar.gz and created a Dockerfile:

FROM scratch
ADD disk.tar.gz /

I can then run that image with /sbin/init like bootloose does. The start-up sequence ends with a loop trying to find a tty from /dev/tty1.../dev/tty4 for starting a console, but looks like it's "up" enough so that I can docker exec into it. Looks like everything is working, but there's no sshd preinstalled, other than that, it should probably work just fine as a "bootoose image". All bootloose does is that it starts a container with the command /sbin/init then docker execs into it and appends the ssh pubkey into /root/.ssh/authorized_keys.

There are go packages for interacting with the image server and reading qcow2 files, so I guess it would be possible to have bootloose download lxd images and create docker containers, but there would still have to be some customization for example to install sshd.

@kke
Copy link
Contributor

kke commented Oct 25, 2023

Of course it could just start it as-is and if there's no sshd, so be it. Bootloose could include an exec command so you could do something like bootloose exec node0 /bin/bash to run a shell in the "machine" if there's no ssh.

@ncopa
Copy link
Contributor Author

ncopa commented Oct 25, 2023

I wonder how/where lxd pulls the images from? https://images.linuxcontainers.org/

@kke
Copy link
Contributor

kke commented Oct 26, 2023

Yes I think that's the repo, https://github.com/lxc/incus/tree/main/client somehow downloads images from there, there are some commits that mention images.linuxcontainers.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants