搭建在线编程环境
1、开通ECS云服务器
这个昨天已经搞定了,今天就不详细说了,详情见:领取ECS资源获取ECS资源
2、服务器管理软件
首先下载服务器管理软件
-
vscode(代码编辑软件)
-
FinalShell(服务器管理软件)
3、下载Docker
-
关于Docker
Docker属于Linux容器的一种封装,能够提供简单易用的容器使用接口。它是目前最流行的Linux容器解决方案。
Docker的意思就是集装箱,可以快速集成多个环境。
-
首先连接服务器,在连接服务器之后输入以下命令:
//安装Docker环境 curl -sSL https://get.daocloud.io/docker | sh //安装Docker-Compose环境 curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/dockercompose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
4、部署WebIDE
-
创建项目文件夹
mkdir -p /home/coder/project
-
运行下面命令
docker run -it -p 80:8080 --name code -v "/home/coder/project:/home/coder/project" codercom/code-server:latest
-
Code-sever部署中
-
输入第二条命令时遇到错误
解决方法:
netstat -ntlp 找到占用你80端口的进程
kill 838
然后重启docker容器
docker restart
-
进入界面,输入密码,大功告成