Skip to content

Instantly share code, notes, and snippets.

@satmandu
Last active April 17, 2024 17:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satmandu/d8365cb70b899901a05290d31c04909a to your computer and use it in GitHub Desktop.
Save satmandu/d8365cb70b899901a05290d31c04909a to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p $PPID) in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
fi
if [ -z ${PAGER+x} ]; then
echo "PAGER is not set."
else
PAGER_PASSTHROUGH=-e
PAGER_PASSTHROUGH+=" "
PAGER_PASSTHROUGH+=CONTAINER_PAGER=${PAGER}
fi
if [ -z ${TZ+x} ]; then
echo "TZ is not set."
else
TZ_PASSTHROUGH=-e
TZ_PASSTHROUGH+=" "
TZ_PASSTHROUGH+=TZ=${TZ}
fi
X11=-e
X11+=" "
X11+=DISPLAY=${DISPLAY:-:0.0}
X11+=" "
if ! [[ $SESSION_TYPE == remote/ssh ]] && [ -d /tmp/.X11-unix ]; then
X11+=" -v /tmp/.X11-unix:/tmp/.X11-unix "
fi
if [ -f "$HOME"/.Xauthority ]; then
X11+=--volume=$HOME/.Xauthority:/home/chronos/user/.Xauthority:rw
X11+=" "
X11+=--volume=$HOME/.Xauthority:/home/chronos/.Xauthority:rw
fi
docker pull --platform linux/386 satmandu/crewbuild:alex-i686.m58
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --init --platform linux/386 --rm --net=host ${PAGER_PASSTHROUGH} ${TZ_PASSTHROUGH} ${X11} -e LOCALRC="${LOCALRC}" -v $(pwd)/pkg_cache:/usr/local/tmp/packages -v $(pwd):/output -h $(hostname)-i686 -it satmandu/crewbuild:alex-i686.m58
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p $PPID) in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
fi
if [ -z ${PAGER+x} ]; then
echo "PAGER is not set."
else
PAGER_PASSTHROUGH=-e
PAGER_PASSTHROUGH+=" "
PAGER_PASSTHROUGH+=CONTAINER_PAGER=${PAGER}
fi
if [ -z ${TZ+x} ]; then
echo "TZ is not set."
else
TZ_PASSTHROUGH=-e
TZ_PASSTHROUGH+=" "
TZ_PASSTHROUGH+=TZ=${TZ}
fi
X11=-e
X11+=" "
X11+=DISPLAY=${DISPLAY:-:0.0}
X11+=" "
if ! [[ $SESSION_TYPE == remote/ssh ]] && [ -d /tmp/.X11-unix ]; then
X11+=" -v /tmp/.X11-unix:/tmp/.X11-unix "
fi
if [ -f "$HOME"/.Xauthority ]; then
X11+=--volume=$HOME/.Xauthority:/home/chronos/user/.Xauthority:rw
X11+=" "
X11+=--volume=$HOME/.Xauthority:/home/chronos/.Xauthority:rw
fi
docker pull --platform linux/arm/v7 satmandu/crewbuild:fievel-armv7l.m91
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --init --platform linux/arm/v7 --rm --net=host ${PAGER_PASSTHROUGH} ${TZ_PASSTHROUGH} ${X11} -e LOCALRC="${LOCALRC}" -v $(pwd)/pkg_cache:/usr/local/tmp/packages -v $(pwd):/output -h $(hostname)-armv7l -it satmandu/crewbuild:fievel-armv7l.m91
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p $PPID) in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
fi
if [ -z ${PAGER+x} ]; then
echo "PAGER is not set."
else
PAGER_PASSTHROUGH=-e
PAGER_PASSTHROUGH+=" "
PAGER_PASSTHROUGH+=CONTAINER_PAGER=${PAGER}
fi
if [ -z ${TZ+x} ]; then
echo "TZ is not set."
else
TZ_PASSTHROUGH=-e
TZ_PASSTHROUGH+=" "
TZ_PASSTHROUGH+=TZ=${TZ}
fi
X11=-e
X11+=" "
X11+=DISPLAY=${DISPLAY:-:0.0}
X11+=" "
if ! [[ $SESSION_TYPE == remote/ssh ]] && [ -d /tmp/.X11-unix ]; then
X11+=" -v /tmp/.X11-unix:/tmp/.X11-unix "
fi
if [ -f "$HOME"/.Xauthority ]; then
X11+=--volume=$HOME/.Xauthority:/home/chronos/user/.Xauthority:rw
X11+=" "
X11+=--volume=$HOME/.Xauthority:/home/chronos/.Xauthority:rw
fi
docker pull --platform linux/arm/v7 satmandu/crewbuild:strongbad-armv7l.m121
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --init --platform linux/arm/v7 --rm --net=host ${PAGER_PASSTHROUGH} ${TZ_PASSTHROUGH} ${X11} -e LOCALRC="${LOCALRC}" -v $(pwd)/pkg_cache:/usr/local/tmp/packages -v $(pwd):/output -h $(hostname)-armv7l -it satmandu/crewbuild:strongbad-armv7l.m121
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p $PPID) in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
fi
if [ -z ${PAGER+x} ]; then
echo "PAGER is not set."
else
PAGER_PASSTHROUGH=-e
PAGER_PASSTHROUGH+=" "
PAGER_PASSTHROUGH+=CONTAINER_PAGER=${PAGER}
fi
if [ -z ${TZ+x} ]; then
echo "TZ is not set."
else
TZ_PASSTHROUGH=-e
TZ_PASSTHROUGH+=" "
TZ_PASSTHROUGH+=TZ=${TZ}
fi
X11=-e
X11+=" "
X11+=DISPLAY=${DISPLAY:-:0.0}
X11+=" "
if ! [[ $SESSION_TYPE == remote/ssh ]] && [ -d /tmp/.X11-unix ]; then
X11+=" -v /tmp/.X11-unix:/tmp/.X11-unix "
fi
if [ -f "$HOME"/.Xauthority ]; then
X11+=--volume=$HOME/.Xauthority:/home/chronos/user/.Xauthority:rw
X11+=" "
X11+=--volume=$HOME/.Xauthority:/home/chronos/.Xauthority:rw
fi
docker pull --platform linux/amd64 satmandu/crewbuild:nocturne-x86_64.m123
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --init --platform linux/amd64 --rm --net=host ${PAGER_PASSTHROUGH} ${TZ_PASSTHROUGH} ${X11} -e LOCALRC="${LOCALRC}" -v $(pwd)/pkg_cache:/usr/local/tmp/packages -v $(pwd):/output -h $(hostname)-x86_64 -it satmandu/crewbuild:nocturne-x86_64.m123
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p $PPID) in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
fi
if [ -z ${PAGER+x} ]; then
echo "PAGER is not set."
else
PAGER_PASSTHROUGH=-e
PAGER_PASSTHROUGH+=" "
PAGER_PASSTHROUGH+=CONTAINER_PAGER=${PAGER}
fi
if [ -z ${TZ+x} ]; then
echo "TZ is not set."
else
TZ_PASSTHROUGH=-e
TZ_PASSTHROUGH+=" "
TZ_PASSTHROUGH+=TZ=${TZ}
fi
X11=-e
X11+=" "
X11+=DISPLAY=${DISPLAY:-:0.0}
X11+=" "
if ! [[ $SESSION_TYPE == remote/ssh ]] && [ -d /tmp/.X11-unix ]; then
X11+=" -v /tmp/.X11-unix:/tmp/.X11-unix "
fi
if [ -f "$HOME"/.Xauthority ]; then
X11+=--volume=$HOME/.Xauthority:/home/chronos/user/.Xauthority:rw
X11+=" "
X11+=--volume=$HOME/.Xauthority:/home/chronos/.Xauthority:rw
fi
docker pull --platform linux/amd64 satmandu/crewbuild:nocturne-x86_64.m90
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --init --platform linux/amd64 --rm --net=host ${PAGER_PASSTHROUGH} ${TZ_PASSTHROUGH} ${X11} -e LOCALRC="${LOCALRC}" -v $(pwd)/pkg_cache:/usr/local/tmp/packages -v $(pwd):/output -h $(hostname)-x86_64 -it satmandu/crewbuild:nocturne-x86_64.m90
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p $PPID) in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
fi
if [ -z ${PAGER+x} ]; then
echo "PAGER is not set."
else
PAGER_PASSTHROUGH=-e
PAGER_PASSTHROUGH+=" "
PAGER_PASSTHROUGH+=CONTAINER_PAGER=${PAGER}
fi
if [ -z ${TZ+x} ]; then
echo "TZ is not set."
else
TZ_PASSTHROUGH=-e
TZ_PASSTHROUGH+=" "
TZ_PASSTHROUGH+=TZ=${TZ}
fi
X11=-e
X11+=" "
X11+=DISPLAY=${DISPLAY:-:0.0}
X11+=" "
if ! [[ $SESSION_TYPE == remote/ssh ]] && [ -d /tmp/.X11-unix ]; then
X11+=" -v /tmp/.X11-unix:/tmp/.X11-unix "
fi
if [ -f "$HOME"/.Xauthority ]; then
X11+=--volume=$HOME/.Xauthority:/home/chronos/user/.Xauthority:rw
X11+=" "
X11+=--volume=$HOME/.Xauthority:/home/chronos/.Xauthority:rw
fi
docker pull --platform linux/arm/v7 satmandu/crewbuild:strongbad-armv7l.m121
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --init --platform linux/arm/v7 --rm --net=host ${PAGER_PASSTHROUGH} ${TZ_PASSTHROUGH} ${X11} -e LOCALRC="${LOCALRC}" -v $(pwd)/pkg_cache:/usr/local/tmp/packages -v $(pwd):/output -h $(hostname)-armv7l -it satmandu/crewbuild:strongbad-armv7l.m121
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p $PPID) in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
fi
if [ -z ${PAGER+x} ]; then
echo "PAGER is not set."
else
PAGER_PASSTHROUGH=-e
PAGER_PASSTHROUGH+=" "
PAGER_PASSTHROUGH+=CONTAINER_PAGER=${PAGER}
fi
if [ -z ${TZ+x} ]; then
echo "TZ is not set."
else
TZ_PASSTHROUGH=-e
TZ_PASSTHROUGH+=" "
TZ_PASSTHROUGH+=TZ=${TZ}
fi
X11=-e
X11+=" "
X11+=DISPLAY=${DISPLAY:-:0.0}
X11+=" "
if ! [[ $SESSION_TYPE == remote/ssh ]] && [ -d /tmp/.X11-unix ]; then
X11+=" -v /tmp/.X11-unix:/tmp/.X11-unix "
fi
if [ -f "$HOME"/.Xauthority ]; then
X11+=--volume=$HOME/.Xauthority:/home/chronos/user/.Xauthority:rw
X11+=" "
X11+=--volume=$HOME/.Xauthority:/home/chronos/.Xauthority:rw
fi
docker pull --platform linux/arm/v7 satmandu/crewbuild:strongbad-armv7l.m123
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --init --platform linux/arm/v7 --rm --net=host ${PAGER_PASSTHROUGH} ${TZ_PASSTHROUGH} ${X11} -e LOCALRC="${LOCALRC}" -v $(pwd)/pkg_cache:/usr/local/tmp/packages -v $(pwd):/output -h $(hostname)-armv7l -it satmandu/crewbuild:strongbad-armv7l.m123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment