加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 创业 > C语言 > 正文

青岛大学开源OJ平台搭建

发布时间:2020-12-15 03:17:44 所属栏目:C语言 来源:网络整理
导读:源码地址为:https://github.com/QingdaoU/OnlineJudge 可参考的文档为:https://github.com/QingdaoU/OnlineJudgeDeploy/tree/2.0 一、安装所依赖的环境 sudo apt-get update sudo apt-get install -y vim python-pip curl gitsudo apt-get install docker-co

源码地址为:https://github.com/QingdaoU/OnlineJudge

可参考的文档为:https://github.com/QingdaoU/OnlineJudgeDeploy/tree/2.0

一、安装所依赖的环境

sudo apt-get update && sudo apt-get install -y vim python-pip curl git

sudo apt-get install docker-compose

?

二、使用Git克隆项目并完成部署

git clone -b 2.0 https://github.com/QingdaoU/OnlineJudgeDeploy.git && cd OnlineJudgeDeploy

docker-compose up -d(root用户使用该命令)或sudo -E docker-compose up -d(非root用户使用该命令)

?

用户名和密码分别是:root和rootroot

浏览器默认打开为:http://IP地址/

例如http://192.168.126.128,显示界面如下:

?

三、常见问题

常见问题一

错误信息:ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key,or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions,see https://docs.docker.com/compose/compose-file/


解决办法:修改docker-compose.yml中的version由3改为2

?

常见问题二:

错误信息:ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

解决办法:
docker-compose up -d(root用户使用)
非root执行会出现这个异常

非root应该执行这条命令
sudo -E docker-compose up -d

?

四、小结

这个OJ平台是国内开源的相对环境很好搭建的,其实参考官方文档也能搭建,本人之所以写,一来为自己,二为分享给其他朋友,让他们尽可能少吃点亏。

?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读