Adrian May
Adrian May

Reputation: 2182

Boot from docker volume

I'm trying to build Linux From Scratch in docker. It expects a mounted volume on which it'll build a system you can boot from, so my plan was to attach a docker volume to a normal docker ubuntu container to build the LFS system and stuff it into the volume, then boot another docker container from said volume.

It says no to the latter:

docker: Error response from daemon: invalid mount config for type "volume": invalid specification: destination can't be '/'.

That makes sense considering I was trying to boot a ubuntu docker image, but how am I to achieve this?

Perhaps I should be content with a docker image that has a tiny boot partition of its own which then mounts the LFS system volume to find all the /usr stuff. I guess LFS will make that easy, but I'm not sure how to make that docker image. How does one start a docker image from nothing and put grub, vmlinuz, etc into it?

Upvotes: 0

Views: 521

Answers (1)

Viswesn
Viswesn

Reputation: 4880

To answer your question let me first start with booting host OS process - it starts with; BIOS - grub - vmlinuz - os - filesystem - system services - user services; Now coming to docker - It is sandbox and make use of the existing running kernel thus the booting of docker process is; mount filesystem - system services - user services; The volumes are mounted with the base filesystem like ext2, ext3, etc., Since docker is sandbox we can bring more than 1000 dockers in seconds

Upvotes: 0

Related Questions