Closed AntonDzyk closed 12 months ago
No idea I'm afraid. Seems like this is related to https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#setting-up-chrome-linux-sandbox
Would it be possible to run mmdc with some additional config as described here: https://github.com/mermaidjs/mermaid.cli#linux-sandbox-issue ?
Okay, to whoever faces this issue. I did a small workaround in our ci/cd job:
function chrome_workaround() {
# https://github.com/mermaid-js/mermaid-cli/blob/master/docs/linux-sandbox-issue.md
mv /usr/local/bin/mmdc /usr/local/bin/mmdc-original
cat << 'EOF' > /usr/local/bin/puppeteer-config.json
{"args":["--no-sandbox"]}
EOF
cat << 'EOF' > /usr/local/bin/mmdc
#!/usr/bin/env bash
mmdc-original -p /usr/local/bin/puppeteer-config.json "$@"
EOF
chmod +x /usr/local/bin/mmdc
}
It's ugly but it works. You might need to adjust path to mmdc
since it might depend on the installation method.
@lazystone you should be able to apply this same workaround by passing the path to the puppeteer config file using the puppeteer-config
block attribute or mermaid-puppeteer-config
at the document level. Still not ideal but might be preferable over a wrapper mmdc script.
Thanks @pepijnve that's much better:
Create puppeteer-config.json
at the root of the project:
{
"args": [
"--no-sandbox"
]
}
In the build.gradle.kts
:
tasks.asciidoctor {
dependsOn("test")
attributes(
mapOf(
"snippets" to "$snippetsDir",
"srcDir" to file("src"),
// https://github.com/asciidoctor/asciidoctor-diagram/issues/302
"mermaid-puppeteer-config" to file("puppeteer-config.json"),
"mermaid-theme" to "forest"
)
)
}
Is it completed due to one of the above workarounds, or the issue fixed in the source image https://hub.docker.com/r/asciidoctor/docker-asciidoctor?
@marcindulak I am also looking for this, but the docker also doesnt have it yet. tried to user kroki extension,
Note: it sends data to kroki.io site to get the images, you can setup locally also but one more tool
I'm builded docker container from ubuntu:20.04
and I got error:
How I can fix this?