Builders, e.g. for OpenWrt or Linux, prepared by Docker
Go to file
2022-05-24 17:13:00 -04:00
openwrt openwrt: Clean up build input setup, forcing user to set it up 2021-05-09 19:06:22 +00:00
.gitignore gitignore built/ -- for build sentinels 2021-02-08 15:06:19 +00:00
builder-entry.sh Initial setup 2021-02-06 21:47:58 +00:00
builder-start.sh Initial setup 2021-02-06 21:47:58 +00:00
builder.dockerfile feat: builder: Add gcc-multilib 2022-05-24 17:09:43 -04:00
docker_vars.sh openwrt: Make the number of parallel Make jobslots configurable 2021-03-16 19:26:29 +00:00
Makefile cleanup: make: skip a cd to docker_src, as this is our roo Makefile 2022-05-24 17:13:00 -04:00
openwrt-builder-commit.dockerfile fix: cleanup a logically incorrect && ... || shell sequence 2022-05-24 17:11:33 -04:00
openwrt-builder-entry.sh openwrt: output screen's logfile somewhere output can see 2021-02-18 02:28:56 +00:00
openwrt-builder.dockerfile openwrt-builder: dockerfile for an openwrt builder 2021-02-08 15:04:23 +00:00
openwrt-remotes.txt feat: openwrt: Add chunkeey's staging tree for building 2022-05-24 17:02:42 -04:00
README.md openwrt: flesh-out the documentation a bit 2021-03-16 19:41:32 +00:00

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.

  • Set up the diffconfig and file tree for the target you want to build. (The openwrt/menuconfig-% target wraps the menuconfig OpenWrt target for this purpose; see the next point.)

  • Run make on the right (.PHONY) target to build the necessary containers and e.g. build OpenWrt. The target name is based on the action, remote and revision you want; with $action being output, menuconfig or debug.

  • The full name format is: openwrt/${action}-${remote}_${revision}, where $remote is in openwrt-remotes.txt, and with $revision being e.g. a tag, a branch, etc. at the remote you use.

  • Additional files can be added under openwrt/files/.

  • Example run:

cd ${docker_src}/;
make openwrt/menuconfig-mirror_21.02
# Wait for build and go through menuconfig
# Save the OpenWrt .config file to the default location, then quit.
# Once you quit, the diffconfig will be collected and dropped to output/diffconfig.

cp openwrt/output/diffconfig mr16-for-testing.diffconfig
cp mr16-for-testing.diffconfig openwrt/diffconfig
mkdir -p openwrt/files/etc
touch openwrt/files/etc/hello # This will end up in the image at /etc/hello

# With the diffconfig + files in place:
nohup make openwrt/output-mirror_21.02 &

# Watch the output at:
tail -f openwrt/output/screen.log