Improve Docker detection for better Chromium execution #389
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Marp CLI official Docker image had defined
IS_DOCKER
env to tweak internal settings into options that are suited for Docker. However, this approach does not assume an general Docker image. So setting up Marp CLI in a homemade image may become difficult, as pointed out at marp-team/marp#165.This PR will improve Docker detection in Marp CLI.
is-docker
module to detect whether Marp CLI is running within a Docker image, and apply better Chromium options when executing the browser. This module has already used byis-wsl
internally.IS_DOCKER
env, and use a standard wayCHROME_PATH
env to set a specific path to Chromium.--preview
) will set by detectingMARP_USER
env, that is assumed for the official image. They restrictions are not applied to a general image. (GUI app within Docker may render to any X server by right settings)