You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
450 B
Bash

#!/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}" \
1 year ago
${USER}_${CURDIRNAME}_vscode \
code-server
sleep 1
docker logs ${USER}_${CURDIRNAME}_vscode
echo ""
echo "Address: https://$(hostname -i | awk '{ print $1; }'):${PORT}"
echo "Password: $PASSWORD"