cmspam / incus-docker

A project to run incus in docker/podman
Apache License 2.0
15 stars 2 forks source link

how about lxcfs? #1

Closed WebsliceNL closed 6 months ago

WebsliceNL commented 7 months ago

Hi,

How do we get lxcfs to work in this docker/podman setup?

Do we still need to make packages to run on the instance it self? or could it be handled from within the docker container too?

It seems to be abel to start within the container;

/bin/mkdir -p /var/lib/incus-lxcfs /opt/incus/bin/lxcfs /var/lib/incus-lxcfs & /opt/incus/bin/incusd

Kind regards, J

cmspam commented 7 months ago

I haven't used the lxcfs features you ask about, but I don't see any reason it can't run from within the container with the correct set-up since we are using a privileged container.

You may need to pass through more volumes to the container, and you would need to run the daemon.

I'm not familiar enough with its use to say much more though unfortunately, but technologically speaking, I think anything can work in a container. Maybe you just need to modify the script that runs on start?

WebsliceNL commented 6 months ago

Yes, agree.

Need to change the start script to start lxcfs and on docker run I need to add "--volume /var/lib/incus-lxcfs:/var/lib/incus-lxcfs"

I will report back if this works.

WebsliceNL commented 6 months ago

and I need to add some lxcfs options;

/opt/incus/bin/lxcfs /var/lib/incus-lxcfs --enable-loadavg --enable-cfs

cmspam commented 6 months ago

Can you confirm all is working well with the options you showed above? If so, I can add it to the dockerfile and the builds to start it automatically, or with an environment variable.

cmspam commented 6 months ago

I have updated the image to use the required dependencies you mentioned and added the environment variable USELXCFS=true If you add this environment variable, mount your LXCFS mountpoint at /var/lib/lxcfs in the container, as it will run /opt/incus/bin/lxcfs /var/lib/lxcfs --enable-loadavg --enable-cfs when that environment variable is set.