Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Docker detection for better Chromium execution #389

Merged
merged 6 commits into from
Sep 13, 2021

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Sep 12, 2021

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.

  • Uses 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 by is-wsl internally.
  • Make generalize a setting of official Docker image. We no longer use IS_DOCKER env, and use a standard way CHROME_PATH env to set a specific path to Chromium.
  • Some specific restrictions for the official image like disabled GUI option (--preview) will set by detecting MARP_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)

@yhatt yhatt merged commit b237ad1 into main Sep 13, 2021
@yhatt yhatt deleted the dont-rely-is-docker-env branch September 13, 2021 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant