This avoids writing output files into the source tree by changing the imagesoutdir variable to point at the build tree. We can bind mount source and docs-resources as read-only into the build directory and then create symlinks to ensure the docker container sees the appropriate directory layout.
Note: imagesoutdir must be an absolute path since otherwise asciidoctor-mathemtical interprets it as a path relative to the source dir rather than the current working directory (asciidoctor-diagram does the expected thing and interprets it relative to the cwd).
This avoids writing output files into the source tree by changing the imagesoutdir variable to point at the build tree. We can bind mount source and docs-resources as read-only into the build directory and then create symlinks to ensure the docker container sees the appropriate directory layout.
Note: imagesoutdir must be an absolute path since otherwise asciidoctor-mathemtical interprets it as a path relative to the source dir rather than the current working directory (asciidoctor-diagram does the expected thing and interprets it relative to the cwd).