March 8, 2019

232 words 2 mins read



Docker configuration for building Linux From Scratch system

repo name reinterpretcat/lfs
repo link
language Shell
size (curr.) 179 kB
stars (curr.) 514
created 2017-11-21
license MIT License

LFS in VirtualBox


This repository contains docker configuration to build bootable iso image with Linux From Scratch 8.2.


At the moment, I don’t have plans to update scripts to the latest LFS versions. However, pull requests are welcomed.


General idea is to learn Linux by building and running LFS system in isolation from the host system.


Scripts are organized in the way of following book structure whenever it makes sense. Some deviations are done to make a bootable iso image.


Use the following command:

docker rm lfs                                       && \
docker build --tag lfs:8.2 .                        && \
sudo docker run -it --privileged --name lfs lfs:8.2 && \
sudo docker cp lfs:/tmp/lfs.iso .
# Ramdisk you can find here: /tmp/ramdisk.img

Please note, that extended privileges are required by docker container in order to execute some commands (e.g. mount).


Final result is bootable iso image with LFS system which, for example, can be used to load the system inside virtual machine (tested with VirtualBox).


If you have problems with master branch, please try to use stable version from the latest release with toolchain from archive.


This work is based on instructions from Linux from Scratch project and provided with MIT license.

comments powered by Disqus