This container supplies you with a working sbcl-based quicklisp environment in which you can run common lisp web services.
- load packages through env
- swank loaded out of the box
- include system-local sources
- eval sexpressions on boot
- openssl installed for hunchentoot
The BOOT environment variable allows simple launching of serivices. Like -e "BOOT=listly"
. See
"Idiomatic use".
The SYSTEMS environment variable allows systems to be loaded through quicklisp. A space-separated
list is expected like -e "SYSTEMS=jsown hunchentoot"
The EVAL environment variable allows you to specify a specific command to run after all other
commands except for the swank connector. Use like -e "EVAL=(format t \"HELLO WORLD\")"
The /app
folder is added to quicklisp's ql:*local-project-directories*
so ASD files from there
should be picked up automatically.
We expose port 4005 (for swank) and port 80 (for webservices) by default.
Sets the dynamic-space-size of SBCL in MB. SBCL's default value is platform dependent. SBCL defaults to 1024 on Docker x86-64 (checked at 2019/10/14).
Sets SBCL's control-stack-size in MB. SBCL defaults to 2.
Allows logging of the lisp's launch command, providing some insights into performance options.
We place the :docker
keyword in lisp's *FEATURES*
variable so you can check if your service is
currently running in docker. You could then launch on port 80 rather than 8080 or similar, as
you'll be running as root in the docker container.
Ideally, your webservice has the same name as its main package, and the main package should contain
a boot
command which launches the web service.
docker run -d \
-e "BOOT=LISPLY" \
-v ~/code/lisp:/app/ \
-p 8080:80 \
madnificent/lisp-webservice
This will give you a docker container in which the lisply
package is loaded through quicklisp. The package's boot function is then ran and the image is kept running.
Another use would be to load some sources and execute some specific launch command. This would look much like the following:
docker run -d \
-v ~/code/lisp:/app/ \
-e "SYSTEMS=jsown hunchentoot" \
-e "EVAL=(format t \"HELLO WORLD\")" \
--name example-container \
madnificent/lisp-webservice
if you check the logs of this container, you should see "HELLO WORLD"
flashing by and see jsown and hunchentoot being loaded.
docker logs -f example-container
You can connect a running image with slime. The easiest way is binding the port to your local machine.
- Launch the container like:
dr run -d -p 4006:4005 -p 8080:80 madnificent/lisp-webservice
- connect using slime (in emacs)
M-x slime-connect<RET>
127.0.0.1<RET>
4006<RET>
That should be it. You'r REPL is connected to the service.
- last updated at 2019-02-05