#! /bin/sh
# usage: ./docker.sh gforth <args>
# usage: ./docker.sh gforth-fast <args>
# usage: ./docker.sh gforth-itc <args>

# This script runs the given engine in a docker container, with the
# working directory mounted as the working directory /workdir in the
# container, and accessible read/write.

# So you can read from and write to the working directory and its
# subdirectories on the same file system, but all other accesses are
# just inside the container.

# after the docker.sh script you use a gforth engine name and its
# arguments just as if you had gforth available outside the container.

docker run -ti --user=$UID:$GID -e HOME=/homedir \
    --mount type=tmpfs,destination=/homedir,tmpfs-size=64m,tmpfs-mode=1777 \
    -v $PWD:/workdir -w /workdir --rm forthy42/gforth:1.0.1 $@
