Commit 3a6e8e71 authored by Eric Timmons's avatar Eric Timmons
Browse files

Remove a dead Dockerfile

parent a731efea
# This Dockerfile is used to build an image as part of the CI pipeline that is
# used by subsequent jobs. Its purpose is to build an SBCL patched to support
# static executables and leave the build artifacts in the image. Not deleteing
# the artifacts is critical to later build an executable.
ARG sbcl_version=2.1.1
ARG daewok_signing_key=823DF61DEDB633B3DE7B2B7C181191EF9ACF6934
ARG alpine_version=3.13
ARG asdf_version=3.3.4
ARG image_repo=clfoundation/sbcl
FROM $image_repo:$sbcl_version-alpine$alpine_version
WORKDIR /usr/local/src/
# Install prereqs
RUN set -x \
&& apk add --no-cache git ca-certificates curl openssl make gcc musl-dev linux-headers gnupg patch zlib-dev zlib-static
# Download the SBCL source code.
RUN set -x \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& (gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$SBCL_SIGNING_KEY" \
|| gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$SBCL_SIGNING_KEY" \
) \
&& curl -fsSL "https://downloads.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-crhodes.asc" > "sbcl-${SBCL_VERSION}-crhodes.asc" \
&& gpg --batch --verify "sbcl-${SBCL_VERSION}-crhodes.asc" \
&& gpg --batch --decrypt "sbcl-${SBCL_VERSION}-crhodes.asc" > "sbcl-${SBCL_VERSION}-crhodes.txt" \
&& curl -fsSL "https://downloads.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-source.tar.bz2" > "sbcl-${SBCL_VERSION}-source.tar.bz2" \
&& bunzip2 "sbcl-${SBCL_VERSION}-source.tar.bz2" \
&& grep "sbcl-${SBCL_VERSION}-source.tar" "sbcl-${SBCL_VERSION}-crhodes.txt" > "${SBCL_VERSION}-sum-file.txt" \
&& sha256sum -c "${SBCL_VERSION}-sum-file.txt" \
&& tar xf "sbcl-${SBCL_VERSION}-source.tar" \
&& pkill -9 gpg-agent \
&& pkill -9 dirmngr \
&& rm -rf "$GNUPGHOME"
WORKDIR /usr/local/src/sbcl-$SBCL_VERSION/
ARG daewok_signing_key
# Patch the source code.
RUN set -x \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& (gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$daewok_signing_key" \
|| gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$daewok_signing_key" \
) \
# Remove the hardcoding of armv5 as target arch. Use the default provided
# by the base image.
&& sed -i -e "s/CFLAGS += -marm -march=armv5/CFLAGS += -marm/" src/runtime/Config.arm-linux \
&& curl -fsSL "https://www.timmons.dev/static/patches/sbcl/$SBCL_VERSION/static-executable-support-v2.patch" > static-executable-support.patch \
&& curl -fsSL "https://www.timmons.dev/static/patches/sbcl/$SBCL_VERSION/static-executable-support-v2.patch.asc" > static-executable-support.patch.asc \
&& gpg --batch --verify static-executable-support.patch.asc static-executable-support.patch \
&& patch -p1 < static-executable-support.patch \
&& rm static-executable-support.patch static-executable-support.patch.asc \
&& echo "\"$SBCL_VERSION-static-executable-v2\"" > version.lisp-expr \
&& pkill -9 gpg-agent \
&& pkill -9 dirmngr \
&& rm -rf "$GNUPGHOME"
# Build it!
RUN set -x \
&& case "$(cat /etc/apk/arch)" in \
armv7) SBCL_ARCH=arm;; \
aarch64) SBCL_ARCH=arm64;; \
x86_64) SBCL_ARCH=x86-64;; \
*) echo "Unknown arch" >&2; exit 1;; \
esac \
&& export SBCL_ARCH \
&& sh make.sh \
&& sh install.sh
WORKDIR /usr/local/share/common-lisp/source/
# Download ASDF
ARG asdf_version
RUN set -x \
&& curl -fsSL "https://common-lisp.net/project/asdf/archives/asdf-$asdf_version.tar.gz" > asdf.tar.gz \
&& tar xvf asdf.tar.gz \
&& rm asdf.tar.gz \
&& cd asdf-$asdf_version \
&& CL_SOURCE_REGISTRY="$(pwd)//:" sbcl --non-interactive --no-userinit --no-sysinit --load "tools/load-asdf.lisp" --load "uiop/uiop.asd" --load "tools/install-asdf.lisp" >/dev/null 2>/dev/null \
&& sbcl --non-interactive --no-userinit --no-sysinit --eval "(require :asdf)" --eval "(print (asdf:asdf-version))" \
&& cd .. \
&& rm -rf asdf-$asdf_version
WORKDIR /
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment