第一步 拉取RStudio
1
| docker image pull dceoy/rstudio-server
|
第二步 编写自动内网穿透脚本
1 2 3 4 5
| #!/usr/bin/sh HOME=/home/rstudio nohup $HOME/dev/frp_0.38.0_linux_amd64/frpc -c $HOME/etc/frpc.ini > $HOME/log/frp.log 2>&1 & /usr/lib/rstudio-server/bin/rserver --server-daemonize=0 --server-app-armor-enabled=0 /bin/bash
|
/home/gene/zl_liu/rstudio有以上start_frp.sh,赋予可执行权限
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| [common] server_addr = ***.limour.top server_port = *** protocol = kcp tls_enable = true token = *** user = zyy
[web02] type = http local_ip = 127.0.0.1 local_port = 8787 use_compression = true subdomain = z**
|
/home/gene/zl_liu/rstudio下有etc、log文件夹;etc里有以上frpc.ini配置文件;权限开放
第三步 编写docker启动脚本
1 2 3 4 5 6 7 8 9 10 11 12
| #!/bin/sh docker run -d -p 57022:8787 --name Rstudio \ --restart always \ -m 60416M --memory-swap -1 \ -c 1024 \ --cpus 16 \ -v /home/gene/zl_liu/rstudio:/home/rstudio \ -v /home/gene/upload:/home/rstudio/upload \ -v /home/gene/zl_liu/jupytera/dev:/home/rstudio/dev \ -w /home/rstudio \ --entrypoint /home/rstudio/start_frp.sh \ dceoy/rstudio-server
|