Skip to content

Latest commit

 

History

History
152 lines (125 loc) · 5.32 KB

examples.md

File metadata and controls

152 lines (125 loc) · 5.32 KB

Examples

Usage

excalidocker supports 2 running modes:

  • show-config - show configuration file content. This option could be handy when utility is running as a docker image, as it generates the config template for further customization.
  • input-path - path for the docker-compose.yaml to perform the conversion.

To get the help menu execute:

  • for docker image
docker run --rm  etolbakov/excalidocker:latest
  • for artifacts
excalidocker

Docker

  1. Convert a local file Specify the path to the docker-compose.yaml as a INPUT_PATH environment variable for the docker image.
docker run --rm --pull always \
          -v "$(pwd)/data/compose/:/tmp/" \
          -e INPUT_PATH=/tmp/docker-compose.yaml \
          etolbakov/excalidocker:latest \
          > produced-by-image.excalidraw
  1. Convert a remote file (conversion via a GitHub link) Specify the url to the docker-compose.yaml as a INPUT_PATH environment variable for the docker image. Both the GitHub link and the link to the raw file work.
docker run --rm --pull always \
           -e INPUT_PATH=https://github.com/apache/pinot/blob/master/docker/images/pinot/docker-compose.yml \
           etolbakov/excalidocker:latest \
           > produced-by-image-remote.excalidraw
docker run --rm --pull always \
           -e INPUT_PATH=https://raw.githubusercontent.com/apache/pinot/master/docker/images/pinot/docker-compose.yml \
           etolbakov/excalidocker:latest \
           > produced-by-image-remote.excalidraw
  1. Convert a remote file and skip dependency links. Set SKIP_DEPS=true to switch off dependency arrows
docker run --rm --pull always \
           -e INPUT_PATH=https://raw.githubusercontent.com/apache/pinot/master/docker/images/pinot/docker-compose.yml \
           -e SKIP_DEPS=true \
           etolbakov/excalidocker:latest \
           > produced-by-image-no-deps.excalidraw
  1. Convert a remote file and skip dependency links. Set SKIP_NETWORK=true to switch off dependency arrows
docker run --rm --pull always \
           -e INPUT_PATH=https://github.com/etolbakov/excalidocker-rs/blob/main/data/compose/docker-compose-networks.yaml \
           -e SKIP_NETWORK=true \
           etolbakov/excalidocker:latest \
           > produced-by-image-no-network.excalidraw
  1. Convert a local file with the provided config Specify the path to the configuration file excalidocker-config.yaml as a CONFIG_PATH environment variable for the docker image.
   docker run --rm --pull always \
             -v "$(pwd)/data/compose/:/tmp/" \
             -v "$(pwd)/excalidocker-config.yaml:/tmp/excalidocker-config.yaml" \
             -e INPUT_PATH=/tmp/docker-compose.yaml \
             -e CONFIG_PATH=/tmp/excalidocker-config.yaml \
             etolbakov/excalidocker:latest \
             > produced-by-image-config-deps.excalidraw
  1. Show config Specify the SHOW_CONFIG environment variable. This command can be handy to generate a config for further customization.
docker run --rm --pull always \
            -e SHOW_CONFIG=true \
            etolbakov/excalidocker:latest \
            > excalidocker-config.yaml

Artifact

Warning The excalidocker config precedence:

  • the highest priority takes command line argument --config-path

  • otherwise excalidocker expects the excalidocker-config.yaml to be placed near the executable (as per the DEFAULT_CONFIG_PATH constant in excalidraw_config.rs)

  • otherwise excalidocker uses the default configuration (as per the DEFAULT_CONFIG constant in excalidraw_config.rs)

  1. Convert a local file. Specify the path to the docker-compose.yaml as a --input-path command line argument.
excalidocker --input-path ./data/compose/docker-compose.yaml
  1. Convert a local file and produce the result into another file Specify the --input-path argument pointing to the docker-compose.yaml and --output-path for the result.
excalidocker --input-path ./data/compose/docker-compose.yaml --output-path /tmp/result.excalidraw
  1. Convert a remote file (conversion via github link) Specify the url to the docker-compose.yaml as a --input-path command line argument. Both the github link and the link to the raw file work.
excalidocker --input-path https://github.com/apache/pinot/blob/master/docker/images/pinot/docker-compose.yml
excalidocker --input-path https://raw.githubusercontent.com/apache/pinot/master/docker/images/pinot/docker-compose.yml
  1. Convert a remote file and skip dependency links. Specify --skip-dependencies command line argument.
excalidocker --skip-dependencies --input-path https://github.com/apache/pinot/blob/master/docker/images/pinot/docker-compose.yml
  1. Convert a remote file and skip network. Specify --skip-network command line argument.
excalidocker --skip-network --input-path https://github.com/etolbakov/excalidocker-rs/blob/main/data/compose/docker-compose-networks.yaml
  1. Convert a local file with the provided config
excalidocker --config-path /tmp/excalidocker-config.yaml --input-path https://github.com/apache/pinot/blob/master/docker/images/pinot/docker-compose.yml