#!/bin/bash -e BACKUPBALL=/root/docker-sbin.tgz BUILDTOP=/ram/build-docker SBDIR=$PRODTREE/docker/sbin ls -l $SBDIR/docker $SBDIR/dockerd $SBDIR/docker-buildx \ || exit 1 export PATH=$SBDIR:$PATH killany -2 containerd || true killany -2 dockerd || true sleep 2 tar zcf $BACKUPBALL $SBDIR/ || exit 1 containerd >& /var/log/containerd & dockerd >& /var/log/docker & rm -fr $HOME/.docker/cli-plugins/docker-buildx || exit 1 mkdir -p $HOME/.docker/cli-plugins/ || exit 1 cp -p `which docker-buildx` \ $HOME/.docker/cli-plugins/ || exit 1 rm -fr $BUILDTOP || exit 1 mkdir -p $BUILDTOP || exit 1 cd $BUILDTOP || exit 1 git clone https://github.com/docker/docker.git \ docker-main || exit 1 git clone https://github.com/docker/cli.git \ docker-cli || exit 1 git clone https://github.com/docker/buildx.git \ buildx || exit 1 cd $BUILDTOP/docker-main/ || exit 1 make || exit 1 cd $BUILDTOP/docker-cli/ || exit 1 make -f docker.Makefile build || exit 1 cd $BUILDTOP/buildx/ || exit 1 make install || exit 1 ls -l $HOME/.docker/cli-plugins/docker-buildx rm -fr $SBDIR mkdir -p $SBDIR cd $BUILDTOP || exit 1 cp -p docker-main/bundles/binary-daemon/* \ docker-cli/build/docker-linux-amd64 \ $HOME/.docker/cli-plugins/docker-buildx \ $SBDIR/ || exit 1 cd $PRODTREE/docker/sbin || exit 1 rm -fr *.md5 *.sha* || exit 1 rm -fr containerd ctr runc || exit 1 strip * 2> /dev/null || true ln -nsf docker-linux-amd64 docker || exit 1 upx --lzma dockerd docker-linux-amd64 docker-buildx || true upx --lzma vpnkit || true instreplinks -d . /sbin || exit 1 for x in containerd ctr runc do ln -s `which $x` || exit 1 done echo Done SSCRIPT=/$LACARCH/setup/dockderd.boot cat << END > $SSCRIPT || exit 1 killany -2 containerd || true killany -2 dockerd || true sleep 2 containerd >& /var/log/containerd & dockerd >& /var/log/dockerd & END chmod 755 $SSCRIPT || exit 1 pkg-to-loopdir docker || exit 1 /$LACARCH/setup/dockerd.boot >& /dev/null || true