Sujet : Re: Injecting Filesystem Mounts Into A Container
De : Pancho.Jones (at) *nospam* proton.me (Pancho)
Groupes : comp.os.linux.miscDate : 23. Dec 2024, 11:24:49
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vkbdpj$15i3v$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 12/23/24 00:54, Lawrence D'Oliveiro wrote:
I’ve been messing around with setting up simple containers using LXC.
Then I wanted to know: how do I add my home directory (readonly) into
a container so I can install software from there? The only way I could
find was: 1) stop the container 2) modify the config to add a mount
entry for the new directory, and 3) restart the container.
>
I don't know LCX, but in Docker containers the idea is that you have script/config files to specify the container, and you start from those, as opposed to setting up your environment, iteratively, in a long lived container that is persisted between sessions. In effect the development cycle is that you make iterative changes to the container definition files and restart for every change.
It is a slightly different way of thinking, but starting and stopping containers is normally quick and having scripted provisioning is a huge advantage in that it becomes much easier to understand/test/reproduce any container environment. Professionally, I have wasted so much time, understanding environment differences, changes that are made and forgotten. I loved having environments that I can reproduce, tear down, rebuild, test.
It seems quite easy to mount your home folder, or any folder, when starting the container, so why not just do that? Go with the flow, rather than seek to preserve development behaviour from previous development environments.
Yes, you can search the web and find people who have a genuine specific niche reason to do it the old way, but check you really need to do it, rather than adapt and go with the intended way of working with containers.