syzoj 中文安裝指南 docker簡易版
今天,由likecoding的博主給大家帶來如何安裝syzoj
準備工具:
一臺ubuntu18.04的電腦
本文GitHub地址:https://github.com/jyeric/hexo3
本文第二鏈接(自己的hexo博客鏈接):https://jyeric.likecoding.gq
更新將在第二鏈接及github進行更新csdn請關註評論內容
預備依賴項:
1 |
sudo apt-get update && sudo apt-get install -y vim git |
第一步 git clone (註:git內容不是我寫的,出現問題請加入loj群詢問)
1
|
git clone https://github.com/hewenyang/syzoj-docker
|
第二步 sandbox
1 |
cd .. (回到根目錄中) |
下載sandbox (註:sandbox不是我寫的,安全性未知,內容請詢問t123yh)
1
|
https://seafile.t123yh.xyz:2/f/65f061a56f414b3db478/
|
服務器請先下載,使用filezilla進行上傳
第三部 修改文件
1
|
cd ..
|
(返回根目錄)
1
|
vi /etc/default/grub
|
找到 GRUB_CMDLINE_LINUX_DEFAULT
一行,在引號內加入 swapaccount=1
如果在這一行中有其他內容請在引號內先空格,再加入上述內容
備註:配置文件
daemon.json 默認,不建議更改
位置:syzoj-docker/config/daemon.json
1 |
{ |
runner-shared.json默認,不建議更改
位置:syzoj-docker/config/runner-shared.json
1 |
{ |
web.json可以更改,更改請見下面說明
位置:syzoj-docker/config/web.json
1 |
{ |
docker-compose.yml:
位置:syzoj-docker/docker-compose.yml
1 |
version: ‘2.3‘ |
第四部 安裝
回到剛才git clone的目錄
運行 docker-compose up -d
,隨後便可以通過 127.0.0.1:5283 (或您指定的端口)訪問。根據網絡情況,構建過程可能會花費幾分鐘至幾小時不等,也可能由於失敗而中斷,重新執行該指令即可,直到最終顯示出 mysql 和 web 等字樣。
打開你的ip:5283
就可以訪問了,註冊一個號,即可使用。
第五步 安裝後的操作
可以通過 docker exec -it build_web_1 /bin/bash
來訪問容器的 shell。
隨後執行 mysql -hmysql -uroot -proot
可以訪問 MySQL 服務器,執行賦予管理員權限等操作。
在user中的is_admin體現了是不是管理員
然後就可以放題目了!
參考資料
1.官方syzoj:https://github.com/syzoj/syzoj
2.syzoj-docker:https://github.com/hewenyang/syzoj-docker
3.billchenchina的博客:https://billchen.bid/jekyll/update/2018/05/13/SYZOJ-Install-Guide/
更新日期:20180822
syzoj 中文安裝指南 docker簡易版