docker-builder

A small toolchain for setting up, caching and sharing build environments.

Existing envs

openwrt/

For building OpenWrt. Helps you manage build inputs.

See commit 7b2d32b for more details on how to use this, or read on.

Setup

TL;DR:

  • Fix the value of $docker_src in ./docker_vars.sh and at the top of the main Makefile.

  • You may also want to tweak $build_threads.

  • In Docker: Make sure you are using a storage driver (often different than the volume driver) big enough to hold the interim build process; e.g. overlay2. Default Docker as of Ubuntu 20.04 has a 10G limit on volumes.

# /etc/docker/daemon.json
{
    "storage-driver": "overlay2"
}
  • Make sure you point dockerd somewhere you have sufficient space for docker to store images. Example setup, using an override.conf to reset ExecStart and point (-g) dockerd at a 100G-large /dockervl filesystem:
$ systemctl cat docker
# /lib/systemd/system/docker.service
# :
# :
# /etc/systemd/system/docker.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -g /dockervl -H fd:// --containerd=/run/containerd/containerd.sock

[Unit]
After=dockervl.mount
$ sudo df -h /dockervl
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/vg00-dockervl  100G   12G   89G  12% /dockervl

Usage

  • Add new remotes by name-tab-URL to openwrt-remotes.txt.

  • The main Makefile will manage building containers ('builders'); the submakefile in openwrt/ will deal with actually collecting inputs and building.

cd ${docker_src}/;
cp mr16-for-testing.diffconfig openwrt/diffconfig
nohup make openwrt/output-mirror_21.02 &
# output at ...
tail -f openwrt/output/screen.log
Description
Builders, e.g. for OpenWrt or Linux, prepared by Docker
Readme 70 KiB
Languages
Makefile 60.5%
Dockerfile 29.1%
Shell 10.4%