我們的 Representer 是以 Docker 映像檔的形式部署的。
請閱讀工具的一般 Docker 資訊,熟悉它們的運作方式。
當我們執行 Representer 來建立解答的 representation 時,會執行像這樣的 Docker 指令:
docker run \
--rm \
--network none \
--mount type=bind,src="${solution_dir}",dst=/solution \
--mount type=bind,src="${output_dir}",dst=/output \
--tmpfs /tmp:rw \
"exercism/${track_slug}-representer" \
"${exercise_slug}" "/solution" "/output"
可以看到我們傳了三個引數給 Docker 映像檔:
我們所有的 Representer 在實作上都遵循以下慣例:
Dockerfile 位於儲存庫的根目錄。/opt/representer。/opt/representer/bin/run.sh
/opt/representer/bin/run.sh 指令碼接受 3 個引數:
更多資訊請參閱介面。
新的 representer 儲存庫預設會採用這些慣例。