-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
Add OCI
image support
#908
Comments
umoci doesn't support retrieval, for that I used containers/image, which is a redhat library that backs For extraction and manipulation once you have them downloaded, though, umoci is the way to go. |
I think it is also worth exporting the exit code of these app containers somehow, as it's a thing people care about. I was intending to do that, but have gotten distracted by other things :) |
Ah yeah indeed, I remember us talking about the exit code and adding some liblxc logic to expose that to the stop/post-stop hooks. |
|
So I've basically got support for OCI images throughout the codebase and rely on skopeo and umoci to access image servers and convert things into image files we can consume.
This is all working fine and will even get automatic background updates on images and everything, same as what we have with simplestreams. It's missing a lot of optimizations though, the current process downloads a ton of stuff to disk just to repack them and send them back over the network. Ideally we should be able to do all of that as data is streaming through. But this basically unblocks getting the rest of the work done, which is having the LXC driver detect application containers and automatically run them with all the right settings. |
A few more things I've noticed that we'll need to sort out:
|
|
Woah! That was fast! |
The devil's always in the details, so while we have something fun and flashy right now, it's likely going to take a bit longer to sort out all those small issues... |
I have questions. :) How would docker-compose files be handled? Or would the user define the container launch parameters via command line? Will this handle .env files, otherwise potentially passwords are going to be sloshing about in clear text? As a general comment, the ability to launch containers/VM from a config file held in a git would be great. Then a hook to trigger a redeployment of the container after a change to the config would be chef's kiss
|
I don't expect we will be handling docker-compose files, at least not initially. For the Our ability to do |
Nice! @stgraber you've probably looked into it already, but we hacked a LXC OCI template back in the days: https://github.com/lxc/lxc/blob/main/templates/lxc-oci.in |
Yep, that's what I used to figure out most of the logic and tools needed. Incus doesn't use LXC templates and works very differently in the way it handles images and creates the storage part of the container so we can't straight up use the script but it made for a good starting point and a good way to make sure I didn't miss anything. |
Ok yeah makes sense, just checking. Depending on your kernel requirements you could also avoid The DHCPv4 hook was kind of a pain, but I guess for this one you can bundle a small Go dhcpclient. |
Yeah, I'm currently working on the network configuration side of things and already have a minimal DHCP client written in Go, just sorting out the hooks to have it called and be able to safely configure the network in the container. |
I published the PR for OCI support if anyone wants to follow along :) Since last time, I've basically added:
So the main bits to do at this point are:
|
This is what I need. Thank you! |
Closes lxc#908 Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
While we have no plans to turn Incus into a full Docker or Kubernetes competitor, we do see quite a few cases where folks either need to run Docker alongside Incus for just a couple of small services or are running Docker inside of an Incus container to achieve the same.
This is particularly common with things like IoT services which come in extremely trivial application containers as their primary distribution mechanism.
To better handle this, Incus should get the ability to create containers from OCI image registries.
The general expectation then would be to do something like:
This would be roughly equivalent to the traditional
docker run hello-world
.To handle this, at minimum we'll need:
client
packageoci
protocol to retrieve container images on the server sideenvironment.XYZ
)proxy
devices)We'll also likely want to add an extra config key to allow setting a restart policy.
For system containers, that's not really needed as
init
usually doesn't die and if it does, you usually want to know about it and not blindly restart it, but for application containers, it's a bit of a different story and much more common to need a restart policy of some kind.It would also be good to have some kind of extra key in the API to tell us whether a container is a system container or an application container. That would then let us show something like:
The text was updated successfully, but these errors were encountered: