Skip to main content

Preinstall Binaries

Workers in Windmill can preinstall binaries. This allows them to execute these binaries in subprocesses or directly within bash. While some common binaries like npm, aws-cli, kubectl, and helm are already present in the standard images, you can add more by extending the base image of Windmill.

Init scripts

For an efficient way to preinstall binaries without the need to modify the base image, see Init Scripts.

Below are the steps and examples to extend the base image:

# or FROM for extending the enterprise edition

RUN apt-get update && apt install [...]

CMD ["windmill"]

Example: Installing Puppeteer (via npm)


RUN apt update
RUN apt install npm -y
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update -y
RUN apt install nodejs libnss3-dev libatk1.0-0 libatk-bridge2.0-0 libcups2-dev libdrm-dev libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev\
libgbm-dev libpango-1.0 libcairo-dev libasound-dev -y
RUN npm install -g puppeteer -y

CMD ["windmill"]

Note: The example above uses the enterprise edition (windmill-ee) as the base.

Example: Installing Playwright (via pip)


RUN pip install playwright
RUN playwright install
RUN playwright install-deps

CMD ["windmill"]

Note: The example above uses the enterprise edition (windmill-ee) as the base.

Examples with docker compose

All examples above can be used in your docker-compose.yml by specifying the build context.


image: ${WM_IMAGE}

With the following:

context: ./path/to/dockerfile

Note that you can pass environment variables from your .env file via the args above and use them in your Dockerfile:



Init Scripts

Init scripts provide a method to pre-install binaries or set initial configurations without the need to modify the base image. This approach offers added convenience. Init Scripts are executed at the beginning when the worker starts, ensuring that any necessary binaries or configurations are set up before the worker undertakes any other job.

Init Scripts Infographics

Any scripts are set from the Worker Management UI, at the worker group level. Any script content specified in INIT_SCRIPT will be executed at the beginning when each worker of the worker group starts.

When adjustments are made in the Worker Management UI, the workers will shut down and are expected to be restarted by their supervisor (Docker or k8s).

The execution of Init Scripts is inspectable in the superadmin workspace, with Kind = All filter. The path of those executions are init_script_{worker_name}.

Worker Group edit config

Example: Installing Playwright (via pip)

pip install playwright
export PATH=$PATH:/tmp/.local/bin
playwright install
playwright install-deps

More at: