Skip to content

Instantly share code, notes, and snippets.

@fukamachi
Last active September 1, 2021 13:36
Show Gist options
  • Save fukamachi/4b45c5bfa06904e60a72c08531731bdb to your computer and use it in GitHub Desktop.
Save fukamachi/4b45c5bfa06904e60a72c08531731bdb to your computer and use it in GitHub Desktop.
Dockerfile example to build Common Lisp app with Qlot
# syntax=docker/dockerfile:experimental
ARG SBCL_VERSION=2.1.8
ARG QLOT_VERSION=0.11.4
FROM fukamachi/qlot:${QLOT_VERSION}
WORKDIR /app
COPY qlfile /app
COPY qlfile.lock /app
RUN --mount=type=cache,target=/app/.cache/qlot \
qlot install --no-deps --cache .cache/qlot
FROM clfoundation/sbcl:${SBCL_VERSION}-slim
COPY --from=0 /app/.qlot /app/.qlot
WORKDIR /app
RUN set -x; \
mkdir -p "$HOME/.config/common-lisp/source-registry.conf.d/" && \
echo '(:tree "/app")' >> "$HOME/.config/common-lisp/source-registry.conf.d/app.conf"
COPY entrypoint.sh /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
#!/bin/bash
exec sbcl --noinform --non-interactive \
--load .qlot/setup.lisp \
--eval '(ql:quickload :hello-world)' \
--eval '(hello-world:main)' \
--quit
all: build
.PHONY: build
build:
DOCKER_BUILDKIT=1 docker build -t hello-world .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment