Dockerfile 3.36 KB
Newer Older
1
2
3
4
5
6
7
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM debian:buster

8
9
ENV SBCL_COMMIT 8efa331cd04d65d4b00c5b32845718e45b93b1a9
ENV SBCL_VERSION 2.1.0.30-8efa331
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ENV SBCL_SIGNING_KEY D6839CA0A67F74D9DFB70922EBD595A9100D63CD

WORKDIR /usr/local/src/

# hadolint ignore=DL3003,DL3008
RUN set -x \
    && case "$(dpkg --print-architecture)" in \
    armhf) SBCL_ARCH=arm; SBCL_BINARY_ARCH_CODE=armhf; SBCL_BINARY_VERSION=1.4.11;; \
    arm64) SBCL_ARCH=arm64; SBCL_BINARY_ARCH_CODE=arm64; SBCL_BINARY_VERSION=1.4.2;; \
    # Limit to 1.5.5 because that's when the glibc version used to build was bumped
    amd64) SBCL_ARCH=x86-64; SBCL_BINARY_ARCH_CODE=x86-64; SBCL_BINARY_VERSION=1.5.5;; \
    *) echo "Unknown arch" >&2; exit 1;; \
    esac \
    && export SBCL_ARCH \
    && export SBCL_BINARY_ARCH_CODE \
    && export SBCL_BINARY_VERSION \
    && download_and_validate_hashes() { \
         curl -fsSL "https://downloads.sourceforge.net/project/sbcl/sbcl/${1}/sbcl-${1}-crhodes.asc" > "sbcl-${1}-crhodes.asc" \
         && gpg --batch --verify "sbcl-${1}-crhodes.asc" \
         && gpg --batch --decrypt "sbcl-${1}-crhodes.asc" > "sbcl-${1}-crhodes.txt"; \
       } \
    && download_and_unpack_binary() { \
         url="https://downloads.sourceforge.net/project/sbcl/sbcl/${1}/sbcl-${1}-$SBCL_BINARY_ARCH_CODE-linux-binary.tar.bz2" \
         && curl -fsSL "$url" > "sbcl-${1}-$SBCL_BINARY_ARCH_CODE-linux-binary.tar.bz2" \
         && bunzip2 "sbcl-${1}-$SBCL_BINARY_ARCH_CODE-linux-binary.tar.bz2" \
         && if grep "sbcl-${1}-$SBCL_BINARY_ARCH_CODE-linux-binary.tar" "sbcl-${1}-crhodes.txt" > "${1}-sum-file.txt"; then sha256sum -c "${1}-sum-file.txt"; fi \
         && tar xf "sbcl-${1}-$SBCL_BINARY_ARCH_CODE-linux-binary.tar" \
         && rm -rf "sbcl-${1}-$SBCL_BINARY_ARCH_CODE-linux-binary.tar"; \
       } \
    && download_source() { \
        url="https://github.com/sbcl/sbcl/archive/$1.tar.gz" \
         && curl -fsSL "$url" > "sbcl-${1}.tar.gz" \
         && tar xf "sbcl-${1}.tar.gz"; \
       } \
    && build_and_install_source() { \
         cd "sbcl-$1/" \
46
         && echo "\"$SBCL_VERSION\"" > version.lisp-expr \
47
48
49
         # 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 \
Eric Timmons's avatar
Eric Timmons committed
50
         && sh make.sh "--xc-host=${2}" \
51
52
53
54
         && sh install.sh \
         && cd /usr/local/src; \
       } \
    && apt-get update \
Eric Timmons's avatar
Eric Timmons committed
55
    && apt-get install -y --no-install-recommends curl gnupg ca-certificates make dirmngr bzip2 build-essential \
56
57
58
59
60
61
62
63
    && GNUPGHOME="$(mktemp -d)" \
    && export GNUPGHOME \
    && gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys ${SBCL_SIGNING_KEY} \
    && download_and_validate_hashes "$SBCL_BINARY_VERSION" \
    && download_and_unpack_binary "$SBCL_BINARY_VERSION" \
    && download_source "$SBCL_COMMIT" \
    && build_and_install_source "$SBCL_COMMIT" "/usr/local/src/sbcl-${SBCL_BINARY_VERSION}-$SBCL_BINARY_ARCH_CODE-linux/run-sbcl.sh" \
    && rm -rf "$GNUPGHOME" ./* \
Eric Timmons's avatar
Eric Timmons committed
64
    && apt-get remove -y curl gnupg ca-certificates make dirmngr bzip2 build-essential \
65
66
67
68
69
70
71
72
73
74
75
    && apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/* \
    && sbcl --version

WORKDIR /

COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["sbcl"]