Skip to content

Instantly share code, notes, and snippets.

@kbingham
Created February 26, 2020 17:30
Show Gist options
  • Save kbingham/073e694a2edff2846a90f0972d815133 to your computer and use it in GitHub Desktop.
Save kbingham/073e694a2edff2846a90f0972d815133 to your computer and use it in GitHub Desktop.
#!/bin/sh
CONTAINER="$1"
shift
XFORWARD="-e DISPLAY=$DISPLAY.0 -v /tmp/.X11-unix:/tmp/.X11-unix"
#
# We can now run in 'arm64' containers:
# docker run -it --rm multiarch/alpine:aarch64-edge
#
echo Executing "$@" in "$CONTAINER"
docker run \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
-v "$PWD":"$PWD" \
-v "$HOME":"$HOME" \
-v "/opt":"/opt" \
-v "/opt/root":"/opt/root" \
-v "/var/lib/tftpboot":"/var/lib/tftpboot" \
$XFORWARD \
-w "$PWD" -it $CONTAINER "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment