Skip to content

Instantly share code, notes, and snippets.

@necrose99
Created September 27, 2018 21:59
Show Gist options
  • Save necrose99/8a3f9184dbcc8d59640db078e2fdfc72 to your computer and use it in GitHub Desktop.
Save necrose99/8a3f9184dbcc8d59640db078e2fdfc72 to your computer and use it in GitHub Desktop.
From Scratch
## From bbvol (bussybox in a chroot~y like cage) for building or un-fucking a broken container...
# https://hub.docker.com/add/automated-build/(Your-name) settings should be able to add as a build setting.
## ie From Gentoo/portage adds portage volume thats curent. adds to yur docker a /usr/portage/ thats least curent to curent day...
##
## add the from busybox/bb-tools-vol & wala tools... for building.. in cloud..
##
## else FROM busybox/bb-tools-vol in own new Dockerfile...
## ADD your other scripts/static tools yourname_/bb-tools-vol_extra add your carp'lets for your own use/cases..
## autobuilding a vanilla arm64/arm7hf rootfs in docker main usecase
## having iot images just build might be another..
## dumping iso's to rebuild might be my other use case..
#
## others fixing a fubar'ed docker container from buring back to production...
## however keep the busybox/bb-tools-vol as light and simple best..
## let users add own static tools.. for diag or buidling likewise thornier containers..
## useage as a temporay replacement for bash and other tools as dockerhub/quay.io wont let you use qemu and gentoo arm64 infamously is a royal mother F@#$% with qemu-aach64-static
## in cloud ... as your not using privalaged options or binfmt misc...
## qa test emulation or build arm64 dockers that will run on my rented build server push pkgs to bin-host.. and not leave a manual mess..
# ie proot can often shim this but not native /bin/bash your kinda F'ed..
## thus having busybox-amd64 @sh or "bash" in /bb/ hopefully
## Add native x86_64/x86 or etc binaries to BB folder ie Microfied "Chroot"
ADD https://busybox.net/downloads/binaries/1.24.0.git-defconfig-multiarch/busybox-x86_64 /bb/busybox
## preferably hook the freshbuild... https://github.com/docker-library/busybox binaries > /bb/busybox...
## replace with x86 or bsd-exec bin etc or else matching your native hardware..
## Define Busybox.. for utilitarion vol...
VOL /bb/
## to do... make the script.. or swipe the script..
ADD URI-git ..... bb-links-build.sh /bb/bb-links-build.sh
## buuld symlinks to tools.
# https://github.com/MichielDerhaeg/build-linux/issues/17 /busybox --install -s /bb/ would be nice but going to have to script the /facepalm of it. (dear gods...)
## more Woes... never simple is it..
## add a place for others/users too add tools.
## tried in plain english how fucking simple is it to add a busy box binary via CI to /bb and symlink its applets...
### realy simple request as you can use busybox to shim your public builds with bash/sh etc scripts..
## /1000-face-palms for even dare asking build it my fucking self..
## somedays as an admin even in plain f'ing eglish... crowbar+devs+ lots of wacking... get my point now... oh nevermind..
## they hate secops anyhow..
## sometimes you need for some like a quick explanation others a 4 volume copy of war n pease PhD thesis explination.
## CI that builds busybox could like build as a volume editon for meanial tasks like building a non-native docker , (using busybox.net bins for now)
# docker container broke badly with os updates
## bb vol could add usefull tools to fix containers when shit hits fan... or when other methiods fail...
## however having <busybox-(arch??)> autoupdate as it builds would be a plus as so I don't have to update the binary all the time so less admin hell.
## https://github.com/andrew-d/static-binaries
## aget / wget bins.. python or other nice static utilities
## need to add also..
## define bash-static at /bb/bin/bash /via ADD or fake it against busybox-sh.
##
## https://code.fb.com/data-infrastructure/xars-a-more-efficient-open-source-system-for-self-contained-exe perhaps usefull.
## so this is a very hack-ish solution/shim to permit scripts to run via x86/amd64 for iso unpack and or unpack of rootfs non native tarballs via busybox...
or iso rootfs's that take longer than dockerhub realy likes.
## /bin/bash say for RPI-Gentoo arm7hf or arm64 wont run without qemu. and if qemu-static is stale as hell... may quit runing...
## also Dockerhub **busybox temp layer offten dies** ... so if 7zip somelinux.ios squashfs |unsquashfs > / && update-pkgs.sh ... && /bin/bash/@ iso-repacker.sh
## ***30 secounds or less** till busybox on that end dies.. yup if you cloud iso rebuilder dies fist... sucks.. quay.io often will do more steps..
## From Scratch gentoo arm64 sure you can do however if tarball changes ... so to must you change dockerfile...
## forking the code to run via busybox from /bb/sh will check remote rootfs repo and relace.. can run the bash/sh
# build script more dynamicly via amd-64-busybox in /bb/busybox @ /bb/sh
## thus making a base vanilla arm64 docker clean no emus etc.. popery tiny init... etc.. or
#https://github.com/krallin/tini use script to probe repo get version x if newer get x+n=newer ...
#anyother bash/sh doable patches ie resolv.conf etc.. (ggole pub dns)
#### update proot static qemu /umeq-static (fork) or quemu-wrappers , or keep vanilla Arm64/etc dockers ... add emulation at next dockerfile From/pass....
## IE probe github urls for ver... if newer get newer versions via bash/sh etc..
##
## likewise if you dumping BSD rootfs's ... /bin/sh /bin/bash zsh may also not work... in dockerhub..
## rm -R /bb/ & etc on real root to prune busybox when no longer required in you real contrainer.
## test emulation entrypoint on dockerhub.. via busybox-amd64 as our shim...
## Run /bb/proot/ (opts? to do/) /bb/quemu-aarch64-wrapper /bin/bash
## else try to rebuild or dynamicly add resin.io bash/qemu wrapper/s as well.
## https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/ which also dont need root ... privlages in cloud env...
## pray bash will now for the love of god run.. only 1000's of by hand intergration ties latter...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment