Template repository for building a MATLAB 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 get_parameters.m from src/tool.yml. At runtime, runTool.m uses the generated helper to validate /in/input.json, load parameters and data paths, and write structured run logs.
/
|- in/
| |- input.json
|- out/
| |- ...
|- src/
| |- tool.yml
| |- runTool.m
| |- get_parameters.m (generated at build time)
| |- CITATION.cff
Build the image from the template root:
docker build -t tbr_matlab_template .Run the sample tool:
docker run --rm -it \
-v "$(pwd)/in:/in" \
-v "$(pwd)/out:/out" \
-e TOOL_RUN=foobar \
tbr_matlab_templateTOOL_RUN is only needed when the image contains more than one tool entry.
- Update
src/tool.ymlto describe your tool. - Add MATLAB or system dependencies in
Dockerfile. - Implement the tool logic in
src/runTool.m. - Rebuild the image so
gotap generaterefreshesget_parameters.m.
The generated get_parameters.m helper is the only supported parameter-access path in this template. It exposes:
get_parameters()get_run_context()get_logger()
On the current arm64 macOS Docker host, mathworks/matlab:r2022b is pulled as linux/amd64, so builds are currently blocked by base-image platform compatibility rather than by the template contract.
The upstream mathworks/matlab:r2022b image requires a MATLAB license configured for cloud use. See the MathWorks container documentation and your license administrator if you need to run the image outside the sample workflow.