Skip to content

A Docker image is a piece of executable code that produces some output given some input.

License

Notifications You must be signed in to change notification settings

a11ce/docker-lisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Lisp

A Docker image is a piece of executable code that produces some output given some input.

Requirements

  • Docker

Setup

First, build the base images and builtins.

./scripts/build-base
./scripts/build-builtins

Then, run the tests. Be patient.

./scripts/run-tests

Usage

Run eval to evaluate expressions.

./scripts/run eval "(cons 1 2)"

Pass --trace to run to see all calls.

./scripts/run --trace eval "(car (cdr (cons 1 (cons 2 (list)))))"

You can also use docker stats and docker events to watch evaluation.

You can write programs:

FROM docker-lisp/eval
CMD ["(define fact (lambda (n) (if (number-equals n 0) 1 (multiply n (fact (subtract n 1))))))", "(fact 3)"]

Build them with

./scripts/build <program path> [name]

or

./scripts/build <program path> # Uses the filename if no name is specified

Then run with

./scripts/run <name>

Scripts

Script Purpose
build <file> [name] Build a Dockerfile into docker-lisp/<name>. Defaults to basename.
build-base Build base images (docker-lisp/base-racket, docker-lisp/base-call)
build-builtins Build all builtin images
run [--trace] [--no-cleanup] <image> [args] Run a docker-lisp/<image> container
run-tests [--no-trace] [--rebuild-base] [prefix filter] Run the tests (with traces by default)
clean Kill all docker-lisp/* containers and remove all built docker-lisp/* images

About

A Docker image is a piece of executable code that produces some output given some input.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published