Last active
September 1, 2021 13:36
-
-
Save fukamachi/4b45c5bfa06904e60a72c08531731bdb to your computer and use it in GitHub Desktop.
Dockerfile example to build Common Lisp app with Qlot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exec sbcl --noinform --non-interactive \ | |
--load .qlot/setup.lisp \ | |
--eval '(ql:quickload :hello-world)' \ | |
--eval '(hello-world:main)' \ | |
--quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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