Vary also ships as a Docker image. No JDK or system-level install required.
docker pull ghcr.io/ccollicutt/vary:latest
Add this to your ~/.bashrc or ~/.zshrc:
alias vary='docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workspace" -w /workspace ghcr.io/ccollicutt/vary:latest'
Reload your shell (source ~/.bashrc or open a new terminal) and verify:
vary --version
This prints something like vary vN (build XXXX). After this, vary works like any other command on your machine.
The Vary compiler lives inside the Docker image, but you write .vary files on your local machine. The -v "$(pwd):/workspace" flag mounts your current directory into the container so the compiler can see your files.
| Flag | What it does |
|---|---|
docker run | Start a new container from the image |
--rm | Remove the container after it exits |
-u "$(id -u):$(id -g)" | Run as your user so created files are owned by you, not root |
-v "$(pwd):/workspace" | Mount your current directory into /workspace inside the container |
-w /workspace | Set the container's working directory to /workspace |
ghcr.io/ccollicutt/vary:latest | The Vary image to run |
For CI pipelines, scripts, or environments where shell aliases aren't available:
docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workspace" -w /workspace ghcr.io/ccollicutt/vary:latest run hello.vary
The image is a standard OCI container. Podman, nerdctl, Colima, or anything else that can pull and run OCI images should work:
alias vary='podman run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workspace" -w /workspace ghcr.io/ccollicutt/vary:latest'
See Getting started for your first program, or VS Code + Dev Container for a full IDE experience.