Running Metanorma with Docker
Installing Metanorma via Docker
Instead of "installing", the Metanorma Docker container makes running Metanorma a breeze for those that already run Docker.
Docker is a platform-independent container engine that allows one to run packaged software easily as all dependencies are bundled within a container image.
Tip
|
Possible reasons to avoid running in Docker
|
The steps are straightforward.
Pulling the Metanorma Docker container
-
Pull the container:
docker pull metanorma/metanorma
or
docker pull metanorma/mn
Running Metanorma using the Docker container
-
Specify the
:local-cache-only:
Metanorma attribute in the AsciiDoc document header to cache bibliographic entries in the local directory (where the command was run) (optional). -
To render a Metanorma document into its intended outputs, execute from within the directory containing the Metanorma document (replacing
{my-document-path}
with your actual document’s filename):Running the Metanorma container on macOS and Linuxdocker run -v "$(pwd)":/metanorma/ -w /metanorma metanorma/metanorma metanorma compile -t {flavor} -x {output-formats} {my-document-path}
or for documents with a Metanorma manifest file:
docker run -v "$(pwd)":/metanorma/ -w /metanorma metanorma/metanorma metanorma site generate {my-document-dir} -o {output-directory} -c {manifest-yml} --agree-to-terms
Running the Metanorma container on Windowsdocker run -v "%cd%":/metanorma/ -w /metanorma metanorma/metanorma metanorma compile -t {flavor} -x {output-formats} {my-document-path}
-
You can speedup document compilation by caching fonts between docker runs by passing extra docker volume. More information on font caching is found on the Font Management page.
Note
|
Commands other than metanorma compile … are also available on the Docker
containers.
See the Usage page of Metanorma CLI
for more details.
|
Tip
|
See the metanorma-docker repository for more information. |