Skip to content

peschee/docker-zx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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