Home

Awesome

Build Status

Common Lisp + Quicklisp OpenShift Build Image

This repository contains the source for building a Quicklisp based Common Lisp application as a reproducible docker image using source-to-image. This docker image is UBI-8 based. The resulting images can be run using docker.

Usage

To build a simple sample-lisp-app application using standalone S2I and then run the resulting image with docker execute:

$ s2i build https://github.com/container-lisp/sample-lisp-app quay.io/containerlisp/lisp-10-ubi9 sample-lisp-app
$ docker run -p 8080:8080 sample-lisp-app

Accessing the application:

Run interactively as above, you can access the sample-lisp-app like so:

$ curl 127.0.0.1:8080

You will likely, however, prefer OpenShift, where applications are created like so:

$ oc new-app quay.io/containerlisp/lisp-10-ubi9~git://github.com/container-lisp/sample-lisp-app

A slynk server will be started on port 4005 for every application. With OpenShift, you can forward port 4005 to your local host and connect to it with SLY for interactive Emacs based development. Just identify the pod running your container with oc get pods, and then....

oc port-forward sample-lisp-app-1-h5o5f 4005

Follow this up in Emacs with...

M-x sly-connect RET RET

To teach Emacs how to translate filenames between the remote and local machines, you'll need to define sly-filename-translations.

There are a number of excellent screencasts and tutorials on using SLY on the project web site at https://github.com/joaotavora/sly.

Also note that instead of using sly, you can also decide to use slime, the traditional emacs common lisp development environment. See below the section about environment variable DEV_BACKEND on how to do this.

To install this image along with sample application template into OpenShift, run the following as the cluster manager:

$ oc create -f lisp-image-streams.json -n openshift
$ oc create -f lisp-web-basic-s2i.json -n openshift

Overriding Quicklisp Packages

If the top-level directory of your source repo contains a local-projects directory, then all of the contents of that directory will be moved to quicklisp's local-projects directory before build-time. This is useful is you ever need to use a different version of a quicklisp-provided package, perhaps with local changes.

Environment variables

To set these environment variables, you can place them as a key value pair into a .s2i/environment file inside your source code repository.

Public Container Images

The ubi9-based S2I images are published on quay.io, as quay.io/containerlisp/lisp-10-ubi9. Image tags are as follows: