#!/bin/bash CURDIRNAME=${PWD##*/} PORT=8400 PASSWORD=$(openssl rand -base64 45) docker run \ -d \ --rm \ --gpus "device=0" \ -p $PORT:8443 \ -v $(pwd):/wd \ --shm-size=10gb \ --name ${USER}_${CURDIRNAME}_vscode \ -e PASSWORD="${PASSWORD}" \ ${USER}_${CURDIRNAME} \ code-server sleep 1 docker logs ${USER}_${CURDIRNAME}_vscode echo "" echo "Address: https://$(hostname -i | awk '{ print $1; }'):${PORT}" echo "Password: $PASSWORD"