Dockerfile for running zx scripts. The container is based on the official Alpine Linux Node image. Some additional tools are installed inside the container:
bash
- because of google/zx#524curl
- because everybody needs a swiss army knifedocker
- in order to be able to run other containersskopeo
- because everybody needs a swiss army knife for docker
This container uses google/zx as an entrypoint
to run .mjs
files. To run files in this container you must mount your source code or use this image as a base image.
- Create an
example.mjs
:
#!/usr/bin/env zx
const name = 'Foo';
await $`echo Hello, ${name}.`;
- Mount
example.mjs
path and run:
docker build -t docker-zx .
docker run --rm -v "$(pwd):/tmp" docker-zx /tmp/example.mjs