GithubHelp home page GithubHelp logo

lisp-docker's Introduction

lisp-docker

Minimal Common Lisp (SBCL, ECL) Docker images

Base Image

Debian 11 (bullseye) Slim

The base image is used to build Common Lisp from source.

Deployment Image

Distroless Debian 11

Uses base image to build standalone application, then copies the executable to distroless nonroot deployment image.

SBCL

FROM ogimart/sbcl-dev:latest AS build

WORKDIR /build-app
COPY . .
RUN make clean && make sbcl-app

FROM gcr.io/distroless/base-debian11:nonroot
COPY --from=build /build-app/app /usr/bin/
CMD ["app"]

ECL

FROM ogimart/ecl-dev:latest AS build

WORKDIR /build-app
COPY . .
RUN make clean && make ecl-app

FROM gcr.io/distroless/base-debian11:nonroot
COPY --from=build /usr/local/lib/libecl.so.21.2.1 /usr/lib/libecl.so.21.2
COPY --from=build /build-app/app /usr/bin/
CMD ["app"]

Size

Hello World App image size (without lisp image compression):

  • SBCL 58.7 MB
  • ECL 33.6 MB

The size of distroless/base-debian11 without app and libs is 17.5MB.

Hello World application with no dependencies:

(defpackage :app
  (:use :cl)
  (:export :main))
(in-package :app)

(defun main ()
  (format t "Hello Lisp!~%"))

ASDF System:

(asdf:defsystem #:app
  :serial t
  :components ((:file "app")))

Build script:

(require 'asdf)
(push "./" asdf:*central-registry*)
(asdf:load-system :app)

#+sbcl (sb-ext:save-lisp-and-die #P"app"
                                 :toplevel #'app:main
                                 :executable t)

#+ecl (asdf:make-build :app
                       :type :program
                       :move-here #P"./"
                       :epilogue-code '(app:main))
#+ecl (si:exit)

Remote REPL Image

Debian 11 (bullseye) Slim

Uses base image, installs quicklisp and sly, and runs slynk repl server.

lisp-docker's People

Contributors

ogimart avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.