[lxc-users] how do you create an image from scratch?
T.C 吳天健
tcwu2005 at gmail.com
Wed Apr 26 15:58:10 UTC 2017
Disable udev and make your own device nodes is a great idea as a
beginning. I call it static dev since /dev was supposed to be tmpfs.
After make tty and other nodes you have a headless (text) linux . Make
/dev/graphics/* if you want to run x11 application.
2017年4月26日 下午11:11,"Spike" <spike at drba.org>寫道:
> thank you Fajar and T.C.,
>
> your experience is very precious and the lxc template looks very good as a
> source of inspiration. I'll try commenting out everything in fstab and see
> what happens. Other pages I found like this one https://snikt.net/blog/
> 2014/03/22/convert-kvm-image-to-lxc-container/ suggested other steps as
> the creation of devices manually as udev is not supported in the container.
> I guess coming from KVM that will be taken care of, however I'm wondering
> if things like system-udevd needs to be adjusted for example. Maybe the lxc
> template will clarify that.
>
> thanks,
>
> Spike
>
> On Wed, Apr 26, 2017 at 8:01 AM Fajar A. Nugraha <list at fajar.net> wrote:
>
>> On Wed, Apr 26, 2017 at 9:40 PM, Spike <spike at drba.org> wrote:
>>
>>> yeah I've seen that link before and used the lxd image publish / export
>>> approach (it's what I'm doing right now in fact). However that post isn't
>>> very clear on what it takes to start from scratch. There is a section on
>>> "Manually building an image", but the critical step (2), says: "Configure
>>> anything that’s needed for the distribution to work properly in a container
>>> (if anything is needed)." and that's really what I'm asking here.
>>>
>>> Because I have everything set up with a fair amount of "magic" to pxe
>>> boot and configure bare metal and KVM instances, I'd like to use that
>>> process and avoid having to write more to create the rootfs.
>>>
>>> So maybe a better question would be, given a qcow2 (or raw) image
>>> created with kvm, what are the necessary steps to convert that so that it
>>> can be used inside a container?
>>>
>>
>>
>> If you have an ubuntu image, you should be able to simply comment-out all
>> entry in fstab, and use it as container rootfs.
>>
>> I have an ubuntu zfsroot AMI for EC2 (which already has an empty fstab).
>> And the steps to convert THAT is 'nothing' (if you can tolerate some delays
>> in service starting, due to zfs errors inside the containers), or simply
>> uninstall some packages (zfsutils-linux, anything related to cloud-init,
>> all kernel versions)
>>
>>
>>
>>> that said having the same steps starting from debootstrap could be handy.
>>>
>>>
>> rootfs created by lxc templates should also be usable in lxd:
>> https://github.com/lxc/lxc/tree/master/templates
>> the files include debootstrap/yum and configure steps.
>>
>> --
>> Fajar
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
>
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170426/5a632f80/attachment.html>
More information about the lxc-users
mailing list