Builders, e.g. for OpenWrt or Linux, prepared by Docker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Martin Kennedy 0d9d0d3cf2 openwrt: Add the "source" mirror, from OpenWrt's git, for building 5 months ago
openwrt openwrt: Clean up build input setup, forcing user to set it up 5 months ago
.gitignore gitignore built/ -- for build sentinels 8 months ago
Makefile Document the main Makefile a little less poorly 6 months ago
README.md openwrt: flesh-out the documentation a bit 6 months ago
builder-entry.sh Initial setup 8 months ago
builder-start.sh Initial setup 8 months ago
builder.dockerfile Initial setup 8 months ago
docker_vars.sh openwrt: Make the number of parallel Make jobslots configurable 6 months ago
openwrt-builder-commit.dockerfile openwrt: Handle if ${remote} is a tag ref instead of a branch 5 months ago
openwrt-builder-entry.sh openwrt: output screen's logfile somewhere output can see 7 months ago
openwrt-builder.dockerfile openwrt-builder: dockerfile for an openwrt builder 8 months ago
openwrt-remotes.txt openwrt: Add the "source" mirror, from OpenWrt's git, for building 5 months ago

README.md

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