Skip to content

Commit

Permalink
📃 docs: docker 代理和镜像编译
Browse files Browse the repository at this point in the history
  • Loading branch information
bosswnx committed Aug 19, 2024
1 parent 7d7e215 commit 04811e7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/现场赛.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 现场赛

## 将新的测例打包进测试镜像

现场赛添加了新的题目,需要将对应测试用例打包进测试镜像当中运行,因此需要重新编译测试用例。

将现场赛的测例的源代码复制到测试镜像源代码的根目录,然后在其 Makefile 文件中加上测例的目标即可。

需要额外注意的是,`splice-test` 编译出来会有好几个文件,需要全部 cp 进 `sdcard` 进行打包。

编译镜像可以使用赛方提供的 docker 进行编译。

## docker 国内访问问题

赛方提供了一个 docker 镜像,里面有对应的编译环境来编译测试用例并打包成镜像。直接在赛方提供的镜像源码根目录下运行指令:

```sh
docker run --rm -it -v $(pwd):/code --privileged --entrypoint make alphamj/os-contest:v7.8 -C /code sdcard
```

但是由于前段时间国内将 dockerhub 给墙了,因此无法直接拉取 docker 镜像,因此需要使用代理。在镜像前面添加上代理的网址(这里使用 `dockerproxy.cn`)即可:

```bash
docker run --rm -it -v $(pwd):/code --privileged --entrypoint make dockerproxy.cn/alphamj/os-contest:v7.8 -C /code sdcard
```

0 comments on commit 04811e7

Please sign in to comment.