diff --git a/Makefile b/Makefile index ee3ce6d1..e9bf06d9 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,8 @@ RUNNER_IMAGE_NAME := ${IMAGE_REPO}/node RUNNER_IMAGE_TAG := bookworm PUPPETEER_IMAGE_NAME := ${IMAGE_REPO}/node-puppeteer PUPPETEER_IMAGE_TAG := bookworm +MERMAID_IMAGE_NAME := ${IMAGE_REPO}/mermaid +MERMAID_IMAGE_TAG := bookworm AUTH_PROXY_IMAGE_NAME := ${IMAGE_REPO}/auth-proxy AUTH_PROXY_IMAGE_TAG := latest CONTAINER_PROXY_IMAGE_NAME := ${IMAGE_REPO}/container-socket-proxy @@ -230,7 +232,7 @@ image_runner_node_ios: submodules image_runner_node -f './imags/cocoapods-runner/Containerfile' \ ./imags/cocoapods-runner -# for mermaid etc +# base for mermaid etc image_runner_node_puppeteer: IMAGE_NAME = ${PUPPETEER_IMAGE_NAME} image_runner_node_puppeteer: IMAGE_TAG = ${PUPPETEER_IMAGE_TAG} image_runner_node_puppeteer: submodules # image_runner_node @@ -242,6 +244,17 @@ image_runner_node_puppeteer: submodules # image_runner_node -f './imags/node-puppeteer/Containerfile' \ ./imags/node-puppeteer +image_runner_mermaid: IMAGE_NAME = ${MERMAID_IMAGE_NAME} +image_runner_mermaid: IMAGE_TAG = ${MERMAID_IMAGE_TAG} +image_runner_mermaid: submodules # image_runner_node + ${CMD} buildx build \ + ${BUILD_OPTIONS} \ + --build-arg "SHELL=${USER_SHELL}" \ + --build-arg "NODE_VERSION=20" \ + -t "${IMAGE_NAME}:${IMAGE_TAG}" \ + -f './imags/node-puppeteer/Containerfile.mermaid' \ + ./imags/node-puppeteer + image_runner_node_all: IMAGE_NAME = ${RUNNER_IMAGE_NAME} image_runner_node_all: IMAGE_TAG = ${RUNNER_IMAGE_TAG} image_runner_node_all: image_runner_node_20 image_runner_node_18 image_runner_node_22 # image_runner_node_ios @@ -489,6 +502,9 @@ images: images_deps image_runner_node image_dnsmasq image_gpg_pk image_dev_shell images_gui: images image_xterm image_firefox image_vnc +# these are optional and not enabled by default due to extra build time and disk usage +images_opt: images_runner_mermaid image_runner_node_all + images_test: images image_nvim_test test: test_nvim test_runner_node test_gpg_pk diff --git a/contrib/bin/mmdc b/contrib/bin/mmdc new file mode 100755 index 00000000..f806e444 --- /dev/null +++ b/contrib/bin/mmdc @@ -0,0 +1,5 @@ +#!/bin/bash +export RUNNER_IMAGE=localhost/l7/mermaid:bookworm +RUNNER_OPTS="${RUNNER_OPTS} -i " +RUNNER_ENV="${RUNNER_ENV} PUPPETEER_CACHE_DIR=/opt/puppeteer" +l7-run-node mmdc ${@} diff --git a/imags/node-puppeteer/Containerfile.mermaid b/imags/node-puppeteer/Containerfile.mermaid new file mode 100644 index 00000000..9117cb7a --- /dev/null +++ b/imags/node-puppeteer/Containerfile.mermaid @@ -0,0 +1,12 @@ +# syntax=docker/dockerfile:1.4-labs +ARG BASE_IMAGE=localhost/l7/node-puppeteer:bookworm +FROM ${BASE_IMAGE} +USER root + +WORKDIR /usr/local/lib +RUN NPM_CONFIG_PREFIX='' npm add 'git+https://github.com/legobeat/mermaid-cli/#02153e234a876c95b44e1af84d02bca65681f6d1' \ + && chown -R node /home/user /home/node \ + # allow user installing new engines but not modifying bundled ones \ + && chown node /opt/puppeteer/ /opt/puppeteer/* + +USER node