a11ce/docker-lisp: A Docker image is a piece of executable code that produces some output given some input.

✨ Read this must-read post from Hacker News 📖

📂 **Category**:

💡 **What You’ll Learn**:

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

Screenshot of a program trace, docker events, and docker stats..

First, build the base images and builtins.

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

Then, run the tests. Be patient.

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

Script Purpose
build [name] Build a Dockerfile into docker-lisp/. 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] [args] Run a docker-lisp/ 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

🔥 **What’s your take?**
Share your thoughts in the comments below!

#️⃣ **#a11cedockerlisp #Docker #image #piece #executable #code #produces #output #input**

🕒 **Posted on**: 1771481929

🌟 **Want more?** Click here for more info! 🌟

By

Leave a Reply

Your email address will not be published. Required fields are marked *