#!/usr/bin/env sh folder_to_serve="$PWD" jddlab_docker_image="stanislavpovolotsky/jddlab:latest" if [ "$#" -eq 1 ]; then if [ "%~1"=="update" ]; then echo "Updating jddlab..." docker pull "$jddlab_docker_image" exit $? fi fi docker_args="" # Allow to access host network. It's usefull to forward adb to instance. # Just run "adb start-server" on host machine and adb inside the instance # will be able to connect to your device. # docker_args+=" --network=host" # Escape application args save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } APP_ARGS=`save "$@"` eval set -- run -it --rm $docker_args -v "$folder_to_serve:/work" "$jddlab_docker_image" "$APP_ARGS" exec "docker" "$@" exit $?