Vary Course

Install Vary with Docker

Get Vary running locally with Docker, verify the compiler, and run a first file from your working directory.

Docker setup

Confirm Docker works

Check that Docker is installed before pulling the Vary image.

docker --version

Run: docker --version

Expected output:

^Docker version [0-9]+\.[0-9]+\.[0-9]+, build [0-9a-f]+$

Create the Vary Docker alias

Create a local vary command that runs the compiler container in your current directory.

alias vary='docker run --rm \
  -u "$(id -u):$(id -g)" \
  -v "$(pwd):/workspace" \
  -w /workspace \
  ghcr.io/ccollicutt/vary:latest'
vary --version

Run: vary --version

Expected output:

^Vary v[0-9]+-alpha\.[0-9]+ .+$

Run a Vary file through Docker

Print the working directory and verify it is the container's /workspace mount.

import system

let here: Str = system.cwd().to_str()
print("cwd=" + here)

Run: vary run main.vary

Expected output:

cwd=/workspace