Last active
March 2, 2024 10:51
-
-
Save elderica/b26fead115830dc070a776e928274ef4 to your computer and use it in GitHub Desktop.
Dockerfiles for Common Lisp programming
This file contains hidden or 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
FROM alpine:latest | |
ARG QUICKLISP_SIGNING_KEY=D7A3489DDEFE32B7D0E7CC61307965AB028B5FF7 | |
ADD https://beta.quicklisp.org/quicklisp.lisp quicklisp.lisp | |
ADD https://beta.quicklisp.org/quicklisp.lisp.asc quicklisp.lisp.asc | |
RUN <<EOT | |
apk update | |
apk add --no-cache gpg sbcl rlwrap | |
gpg --batch --recv-keys $QUICKLISP_SIGNING_KEY | |
gpg --batch --verify quicklisp.lisp.asc quicklisp.lisp | |
rm quicklisp.lisp.asc | |
sbcl --non-interactive \ | |
--load quicklisp.lisp \ | |
--eval '(quicklisp-quickstart:install)' \ | |
--eval '(ql-util:without-prompting (ql:add-to-init-file))' \ | |
--eval '(uiop:quit)' | |
rm quicklisp.lisp | |
EOT | |
ENTRYPOINT ["rlwrap", "sbcl", "--noinform"] |
This file contains hidden or 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
FROM archlinux:latest | |
ARG QUICKLISP_SIGNING_KEY=D7A3489DDEFE32B7D0E7CC61307965AB028B5FF7 | |
ADD https://beta.quicklisp.org/quicklisp.lisp quicklisp.lisp | |
ADD https://beta.quicklisp.org/quicklisp.lisp.asc quicklisp.lisp.asc | |
RUN <<EOT | |
pacman -Sy --noconfirm --disable-download-timeout sbcl rlwrap | |
pacman -Scc --noconfirm | |
gpg --batch --recv-keys $QUICKLISP_SIGNING_KEY | |
gpg --batch --verify quicklisp.lisp.asc quicklisp.lisp | |
rm quicklisp.lisp.asc | |
sbcl --non-interactive \ | |
--load quicklisp.lisp \ | |
--eval '(quicklisp-quickstart:install)' \ | |
--eval '(ql-util:without-prompting (ql:add-to-init-file))' \ | |
--eval '(uiop:quit)' | |
rm quicklisp.lisp | |
EOT | |
ENTRYPOINT ["rlwrap", "sbcl", "--noinform"] |
This file contains hidden or 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
FROM archlinux:base-devel AS sbcl-builder | |
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] | |
ENV SBCL_VERSION=2.4.1 | |
ENV SBCL_SIGNING_KEY=D6839CA0A67F74D9DFB70922EBD595A9100D63CD | |
ENV SBCL_DOWNLOADS_BASE_URL="https://downloads.sourceforge.net/project/sbcl/sbcl" | |
ENV SBCL_HASH_FILE=sbcl-${SBCL_VERSION}-crhodes.asc | |
ENV SBCL_HASH_URL=${SBCL_DOWNLOADS_BASE_URL}/${SBCL_VERSION}/${SBCL_HASH_FILE} | |
ENV SBCL_SRC_TBZ2_FILE=sbcl-${SBCL_VERSION}-source.tar.bz2 | |
ENV SBCL_SRC_TBZ2_URL=${SBCL_DOWNLOADS_BASE_URL}/${SBCL_VERSION}/${SBCL_SRC_TBZ2_FILE} | |
WORKDIR /sbcl-build | |
# Setup pacman | |
RUN pacman-key --init | |
RUN printf '%s\n%s\n%s\n' \ | |
'Server = https://mirrors.cat.net/archlinux/$repo/os/$arch' \ | |
'Server = https://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch' \ | |
'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \ | |
| tee /etc/pacman.d/mirrorlist | |
# Install buildtime dependencies and SBCL from Arch | |
RUN pacman -Syyu --noconfirm --disable-download-timeout base-devel sbcl zstd | |
RUN gpg --batch --recv-keys ${SBCL_SIGNING_KEY} | |
# Fetch encrypted hash file | |
RUN curl -fsSL -o ${SBCL_HASH_FILE} ${SBCL_HASH_URL} \ | |
&& gpg --batch --verify ${SBCL_HASH_FILE} | |
# Fetch source tarball | |
RUN curl -fsSL -o ${SBCL_SRC_TBZ2_FILE} ${SBCL_SRC_TBZ2_URL} \ | |
&& bunzip2 ${SBCL_SRC_TBZ2_FILE} \ | |
&& (gpg --batch --decrypt ${SBCL_HASH_FILE} | grep ${SBCL_SRC_TBZ2_FILE%.bz2} | tee src-checksum) \ | |
&& sha256sum --check src-checksum | |
# Extract source tarball | |
RUN tar -xf ${SBCL_SRC_TBZ2_FILE%.bz2} | |
WORKDIR /sbcl-build/sbcl-${SBCL_VERSION} | |
# Build SBCL | |
RUN source /etc/makepkg.conf \ | |
&& export CFLAGS="${CFLAGS} -D_GNU_SOURCE -fno-omit-frame-pointer" \ | |
&& export LINKFLAGS="${LDFLAGS}" \ | |
&& unset LDFLAGS \ | |
&& unset MAKEFLAGS \ | |
&& sh make.sh --prefix=/usr/local --fancy --dynamic-space-size=4Gb | |
# Install SBCL | |
RUN sh install.sh | |
FROM sbcl-builder AS sbcl-test | |
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] | |
# Install testing dependencies | |
RUN pacman -Syu --noconfirm --disable-download-timeout strace | |
WORKDIR /sbcl-build/sbcl-${SBCL_VERSION}/tests | |
RUN sh run-tests.sh | |
FROM archlinux:base AS sbcl-ready | |
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] | |
ENV QUICKLISP_SIGNING_KEY=D7A3489DDEFE32B7D0E7CC61307965AB028B5FF7 | |
# Setup pacman | |
RUN pacman-key --init | |
RUN printf '%s\n' \ | |
'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \ | |
| tee /etc/pacman.d/mirrorlist | |
# Install runtime dependencies | |
RUN pacman -Syyu --noconfirm --disable-download-timeout rlwrap zstd | |
COPY --from=sbcl-builder /usr/local /usr/local | |
# Download Quicklisp | |
RUN curl -fsSL -o quicklisp.lisp "https://beta.quicklisp.org/quicklisp.lisp" \ | |
&& curl -fsSL -o quicklisp.lisp.asc "https://beta.quicklisp.org/quicklisp.lisp.asc" \ | |
&& gpg --batch --recv-keys ${QUICKLISP_SIGNING_KEY} \ | |
&& gpg --batch --verify quicklisp.lisp.asc quicklisp.lisp \ | |
&& rm quicklisp.lisp.asc | |
# Install Quicklisp | |
RUN /usr/local/bin/sbcl --non-interactive \ | |
--load quicklisp.lisp \ | |
--eval '(quicklisp-quickstart:install)' \ | |
--eval '(ql-util:without-prompting (ql:add-to-init-file))' \ | |
&& rm quicklisp.lisp | |
ENTRYPOINT ["rlwrap", "/usr/local/bin/sbcl", "--noinform"] | |
# Install application | |
#FROM sbcl-ready AS application | |
#SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] | |
#ENTRYPOINT ["make"] |
This file contains hidden or 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
FROM fukamachi/sbcl:latest-debian | |
ARG QUICKLISP_SIGNING_KEY=D7A3489DDEFE32B7D0E7CC61307965AB028B5FF7 | |
ADD https://beta.quicklisp.org/quicklisp.lisp quicklisp.lisp | |
ADD https://beta.quicklisp.org/quicklisp.lisp.asc quicklisp.lisp.asc | |
RUN <<EOT | |
apt-get update | |
apt-get install -y gpg rlwrap | |
gpg --batch --recv-keys $QUICKLISP_SIGNING_KEY | |
gpg --batch --verify quicklisp.lisp.asc quicklisp.lisp | |
rm quicklisp.lisp.asc | |
/usr/local/bin/sbcl --non-interactive \ | |
--load quicklisp.lisp \ | |
--eval '(quicklisp-quickstart:install)' \ | |
--eval '(ql-util:without-prompting (ql:add-to-init-file))' \ | |
--eval '(uiop:quit)' | |
rm quicklisp.lisp | |
EOT | |
ENTRYPOINT ["rlwrap", "sbcl", "--noinform"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment