Stapel is an LFS based linux distribution, which contains:
- Gnu cli tools (install, patch, find, wget, grep, rsync and other);
- Git cli util.
- Python interpreter and Ansible.
Stapel tools built in non-standard root location. Binaries, libraries and other related files are located in the following dirs:
The base of stapel is a Glibc library and linker (
/.werf/stapel/x86_64-lfs-linux-gnu/bin/ld). All tools from
/.werf/stapel are compiled and linked only agains libraries contained in
/.werf/stapel. So stapel is a self-contained distribution of tools and libraries without external dependencies with an independent Glibc, which allows running these tools in arbitrary environment (independently of linux distribution and libraries versions in this distribution).
/.werf/stapel is intent to be mounted into build container based on some base image. Tools from stapel can then be used for some purposes. As stapel tools does not have external dependencies stapel image can be mounted into any base image (alpine linux with musl libc, or ubuntu with glibc — does not matter) and tools will work as expected.
Werf mounts stapel image into each build container when building docker images with stapel builder to enable ansible, git service operations and for other service purposes. More info about stapel builder are available in the article.
Stapel image needs to be updated time to time to update ansible or when new version of LFS is available.
- Make necessary changes to build instructions in
- Update omnibus bundle:
cd stapel bundle update git add -p Gemfile Gemfile.lock
- Pull previous stapel images cache:
- Increment current version in
- Build new stapel images:
- Publish new stapel images:
- As new stapel version is done and published, then change
PREVIOUS_STAPEL_VERSIONenvironment variable in
scripts/stapel/version.shto the same value as
CURRENT_STAPEL_VERSIONand commit changes to the repo.
How build works
Stapel image builder consists of 2 docker stages: base and final.
Base stage is an ubuntu based image used to build LFS system and additional omnibus packages.
Final stage is a pure scratch image which imports only necessary
NOTE: Both base and final docker stages are being published during
scripts/stapel/publish.sh procedure to enable cache during next stapel rebuild.