compile_docker — build notes for docker.tcz (CorePure64 / x86_64)
================================================================

Target: Tiny Core Linux CorePure64 17.x (x86_64 userspace)
Extension: docker.tcz
Upstream: Docker Engine static binaries (not compiled from source on TC)

Why binary packaging (not compiletc)?
------------------------------------
Docker Engine / Moby is a large Go codebase. Official releases publish
statically linked Linux x86_64 binaries that run on any modern glibc-free
or musl host without TC toolchain flags. This extension repacks those
binaries into a squashfs .tcz with Tiny Core helpers (tce.installed +
init.d). Same approach as other binary-only TC extensions (e.g. browser
.deb repacks): provenance and license links are documented; no TC CFLAGS
apply because nothing is compiled here.

Upstream download (binary payload packaged into the .tcz)
---------------------------------------------------------
URL pattern:
  https://download.docker.com/linux/static/stable/x86_64/docker-VERSION.tgz

Example used for this release:
  https://download.docker.com/linux/static/stable/x86_64/docker-29.10.0.tgz

License: Apache-2.0 (Docker, Inc. / Moby contributors)
Source (if rebuild from source is desired):
  https://github.com/moby/moby
  https://github.com/docker/cli
  https://github.com/containerd/containerd
  https://github.com/opencontainers/runc

Apache-2.0: download links for binaries + source are sufficient; the
static .tgz does not need to be attached when size exceeds email limits.

How this .tcz was built (host: macOS or Linux with curl + make)
--------------------------------------------------------------
  git clone <this packaging repo>
  make DOCKER_VERSION=29.10.0 build

Equivalent manual steps:
  1. mkdir -p /tmp/docker-stage/usr/local/bin \
              /tmp/docker-stage/usr/local/tce.installed \
              /tmp/docker-stage/usr/local/etc/init.d
  2. curl -fL -o docker-29.10.0.tgz \
       https://download.docker.com/linux/static/stable/x86_64/docker-29.10.0.tgz
  3. tar -xzf docker-29.10.0.tgz
  4. install -m 0755 docker/* /tmp/docker-stage/usr/local/bin/
  5. install packaging/tce.installed/docker \
       /tmp/docker-stage/usr/local/tce.installed/docker
  6. install packaging/usr/local/etc/init.d/docker \
       /tmp/docker-stage/usr/local/etc/init.d/docker
  7. mksquashfs /tmp/docker-stage docker.tcz -b 4096 -noappend -comp xz -all-root

No strip pass: upstream static binaries are already release-stripped.
No -dev / -doc / -locale split: no headers, man pages, or locales shipped.
No *.la files.

TC runtime helpers added by this packaging
------------------------------------------
  usr/local/tce.installed/docker
    - create docker group; add user tc
    - ensure /var/lib/docker, /etc/docker
    - SSL CA symlink for container registry TLS
  usr/local/etc/init.d/docker
    - start|stop|restart|status for dockerd
    - DOCKER_RAMDISK=true (TC is often RAM-backed)
    - mount cgroup v1 controllers (stock TC lacks CONFIG_CGROUP_BPF)
    - default daemon.json: overlay2, iptables:false, cgroupfs
    - load overlay/veth/bridge/nftables modules when available

Stock CorePure64 17.x kernel notes (not a custom kernel)
--------------------------------------------------------
  - overlay.ko + veth.ko available in base modules → hello-world works
  - no iptables-legacy NAT tables → daemon uses "iptables": false
    (no automatic container NAT / published-port DNAT until nft wired)
  - no CONFIG_CGROUP_BPF → hybrid/cgroup v1 layout required

Dependencies (docker.tcz.dep)
-----------------------------
  net-bridging-KERNEL.tcz
  ipv6-netfilter-KERNEL.tcz
  iptables.tcz
  nftables.tcz
  libnftnl.tcz
  libmnl.tcz
  gmp.tcz
  readline.tcz
  jansson.tcz
  ca-certificates.tcz
  bridge-utils.tcz
  openssl.tcz

KERNEL is the TC placeholder expanded to the running kernel release
(e.g. net-bridging-6.18.2-tinycore64.tcz).

Smoke test
----------
  On CorePure64 17.x (QEMU or bare metal):
    tce-load -i docker.tcz
    sudo /usr/local/etc/init.d/docker start
    docker run --rm hello-world
  Expected: "Hello from Docker!"

Submit QC
---------
  On a CorePure64 box with submitqc.tcz + zsync:
    cd docker_project
    submitqc
  Then pack and send per wiki:creating_extensions
  (this .tcz is ~85MB — over Gmail 25MB; email tcesubmit for alternate transfer).
