Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.12 KB

README.md

File metadata and controls

31 lines (20 loc) · 1.12 KB

docker-zx

Docker Image Version (latest semver)

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#524
  • curl - because everybody needs a swiss army knife
  • docker - in order to be able to run other containers
  • skopeo - because everybody needs a swiss army knife for docker

Usage

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