Template repository for building an R tool that follows the Tool Specification container contract.
This template installs gotap inside the image and uses it as the default runtime shim:
CMD ["gotap", "run", "foobar", "--input-file", "/in/input.json"]At build time, gotap generate creates parameters.R from src/tool.yml. At runtime, run.R uses the generated bindings to validate /in/input.json, load parameters and data paths, and write structured run logs.
/
|- in/
| |- input.json
|- out/
| |- ...
|- src/
| |- tool.yml
| |- run.R
| |- parameters.R (generated at build time)
| |- CITATION.cff
Build the image from the template root:
docker build -t tbr_r_template .Run the sample tool:
docker run --rm -it \
-v "$(pwd)/in:/in" \
-v "$(pwd)/out:/out" \
-e TOOL_RUN=foobar \
tbr_r_templateTOOL_RUN is only needed when the image contains more than one tool entry.
- Update
src/tool.ymlto describe your tool. - Add R or system dependencies in
Dockerfile. - Implement your tool logic in
src/run.R. - Rebuild the image so
gotap generaterefreshesparameters.R.
The generated parameters.R file is not edited by hand. It exposes:
get_parameters()get_run_context()get_logger()
The starter runtime uses get_logger() for structured JSON Lines logging and keeps the sample parsed input visible on standard output.