builds a docker image to run idea in a container, which is based on kasmtech/workspaces-images.
- prepared dev envs: python3、maven-3.9、jdk17、nvm
- bundle jetbrains idea community, support projector server and windowed mode
- postponed ide.tar.gz decompression to
init_services.shreduce image size - change ubuntu tsinghua mirrors、nvm mirrors using
chsrc
- Run the container as a daemon.
--shm-sizedefault is 64MB not enough xfdesktop used, can be listed byipcs -m --human
IMAGE=registry.cn-hangzhou.aliyuncs.com/hylstudio/workspace:2024100901-skykoma-workspace
# IMAGE=registry.hylstudio.local/skykoma-workspace:2024100901
docker run -d --name skykoma-workspace --hostname=ubuntu --shm-size=512m \
-e LOCAL_USER_UID=0 -e PERSISTENT_HOME=1 -e PERSISTENT_HOME_DIR=/data/root \
-e VNC_PW=password \
-e PROJECTOR_SERVER_TOKEN=123456 \
-p 6901:6901 \
-p 2222:22 \
-p 8887:8887 \
-v /data:/data \
$IMAGE- vnc server avaliable pm https://localhost:6901 with basic auth
- User : kasm_user
- Password: see env $VNC_PW
- projector server avaliable on http://localhost:8887 when switch to projector mode
- add query params token when env PROJECTOR_SERVER_TOKEN has been set, such as http://localhost:8887?token=123456
- TODO add more env explain, refer from here.
see build.sh and DockefFile for all details
kasm_entrypoint.sh- persist home dir if env
PERSISTENT_HOMEandPERSISTENT_HOME_DIRhas been set
- persist home dir if env
init_services.sh- unzip idea package if
$PROJECTOR_DIR/ide/ide.tar.gzexists - init idea
idea.propertiesandidea64.vmoptions - disable tips of the day
- disable auto update and new version check
- open idea internal actions menu
- unzip idea package if
kasm_default_profile.shandvnc_startup.shis kasm official file- skip openssl self sign req in
vnc_startup.shif cert file already exists
- skip openssl self sign req in
custom_startup.shwill be executed byvnc_startup.shon kasm starup seq- init
/tmp/autorestartwith value1 - kasm_startup will be execute
- check process using
pgrep -f com.intellij.idea.Main, autorestart if process not exists - if
/tmp/autorestartnot been disabled, execute/projector/ide/bin/idea.shand idea.sh subprocess will not exit
- init
projector_entrypoint.shandnormal_idea_entrypoint.sh- switch projector mode and windowed mode by changing /tmp/ideamode
- TODO replace START_COMMAND depends on env settings on startup
- Thanks kasmtech for providing some great open source tools.