Skip to content

Instantly share code, notes, and snippets.

@AndreSteenveld
Last active November 4, 2020 10:56
Show Gist options
  • Save AndreSteenveld/3ddfe3ca4351eb440055e162df79118a to your computer and use it in GitHub Desktop.
Save AndreSteenveld/3ddfe3ca4351eb440055e162df79118a to your computer and use it in GitHub Desktop.
Using the jsonnet docker image
#! /usr/bin/env bash
# The script wraps around the jsonnet docker image to so it can be run without installing
# python locally. This script is also geared towards a windows setup as it currently is
# environment I'm working in. With the exception of the TTY wrappers I think this should
# generally work for any *nix system as well.
#
# Clearly access to a docker host is required to make this work... For a windows setup
# we will also be assuming that all the relevant drives (C, D, whatever) are mounted on
# the docker host under "/c", "/d", etc.
#
#
# Check if we actually have the jsonnet image, otherwise fetch it. We'll be using the
# mexisme image by default which can be found here: https://hub.docker.com/r/mexisme/jsonnet.
# It comes with some suggested aliases which were the basis of this script.
#
docker pull --quiet mexisme/jsonnet:latest > /dev/null
docker run \
--volume "//c://c" \
--entrypoint "//jsonnet" \
--workdir "/$( cygpath --unix --absolute $PWD )" \
mexisme/jsonnet:latest "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment