Commit d93c819e authored by Eric Timmons's avatar Eric Timmons
Browse files

First commit

parents
Pipeline #3188 failed with stages
in 2 seconds
priv
.env
/build
include:
- project: 'cl-docker-images/ci-helpers'
file: '/cl-docker-images-default-pipeline-v2.yml'
variables:
CL_DOCKER_IMAGES_AMD64: "1"
CL_DOCKER_IMAGES_ARM64V8: "1"
CL_DOCKER_IMAGES_ARM32V7: "1"
CL_DOCKER_IMAGES_WINAMD64: "1"
IMAGE_NAME: static-sbcl
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM alpine:3.13
ENV SBCL_VERSION 2.1.2
ENV SBCL_SIGNING_KEY D6839CA0A67F74D9DFB70922EBD595A9100D63CD
ENV DAEWOK_SIGNING_KEY 823DF61DEDB633B3DE7B2B7C181191EF9ACF6934
WORKDIR /usr/local/src/
# hadolint ignore=DL3003,DL3018
RUN set -x \
&& case "$(cat /etc/apk/arch)" in \
# We can't build --with-sb-prelink-linkage-table on armv7 because of
# how musl has implemented time64 support...
armv7) SBCL_ARCH=arm; SBCL_MAKE_ARGS="--with-sb-linkable-runtime";; \
aarch64) SBCL_ARCH=arm64; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
x86_64) SBCL_ARCH=x86-64; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
*) echo "Unknown arch" >&2; exit 1;; \
esac \
&& export SBCL_ARCH \
&& import_key() { \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$1"; \
} \
&& 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_source() { \
url="https://downloads.sourceforge.net/project/sbcl/sbcl/${1}/sbcl-${1}-source.tar.bz2" \
&& curl -fsSL "$url" > "sbcl-${1}-source.tar.bz2" \
&& bunzip2 "sbcl-${1}-source.tar.bz2" \
&& grep "sbcl-${1}-source.tar" "sbcl-${1}-crhodes.txt" > "${1}-sum-file.txt" \
&& sha256sum -c "${1}-sum-file.txt" \
&& tar xf "sbcl-${1}-source.tar"; \
} \
&& build_and_install_source() { \
cd "sbcl-${1}/" \
# 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 \
&& sh make.sh $SBCL_MAKE_ARGS \
&& sh install.sh \
&& cd /usr/local/src; \
} \
&& apk add --no-cache ca-certificates curl openssl make gcc musl-dev linux-headers gnupg patch \
&& apk add --no-cache sbcl --repository http://dl-3.alpinelinux.org/alpine/edge/community/ \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& import_key "$SBCL_SIGNING_KEY" \
&& import_key "$DAEWOK_SIGNING_KEY" \
&& download_and_validate_hashes "$SBCL_VERSION" \
&& download_source "$SBCL_VERSION" \
&& 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 \
&& (cd "sbcl-$SBCL_VERSION" && patch -p1 < ../static-executable-support.patch) \
&& rm static-executable-support.patch static-executable-support.patch.asc \
&& echo "\"$SBCL_VERSION-static-executable-v2\"" > sbcl-$SBCL_VERSION/version.lisp-expr \
&& build_and_install_source "$SBCL_VERSION" \
&& apk del --no-cache ca-certificates curl openssl make gcc musl-dev linux-headers gnupg sbcl patch \
&& pkill -9 gpg-agent \
&& pkill -9 dirmngr \
&& rm -rf "$GNUPGHOME" ./* \
&& sbcl --version
WORKDIR /
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["sbcl"]
#!/bin/sh
# If the first arg starts with a hyphen, prepend sbcl to arguments.
if [ "${1#-}" != "$1" ]; then
set -- sbcl "$@"
fi
exec "$@"
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM buildpack-deps:buster
ENV SBCL_VERSION 2.1.2
ENV SBCL_SIGNING_KEY D6839CA0A67F74D9DFB70922EBD595A9100D63CD
ENV DAEWOK_SIGNING_KEY 823DF61DEDB633B3DE7B2B7C181191EF9ACF6934
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; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
arm64) SBCL_ARCH=arm64; SBCL_BINARY_ARCH_CODE=arm64; SBCL_BINARY_VERSION=1.4.2; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
# 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; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
*) 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://downloads.sourceforge.net/project/sbcl/sbcl/${1}/sbcl-${1}-source.tar.bz2" \
&& curl -fsSL "$url" > "sbcl-${1}-source.tar.bz2" \
&& bunzip2 "sbcl-${1}-source.tar.bz2" \
&& grep "sbcl-${1}-source.tar" "sbcl-${1}-crhodes.txt" > "${1}-sum-file.txt" \
&& sha256sum -c "${1}-sum-file.txt" \
&& tar xf "sbcl-${1}-source.tar" \
&& mv "sbcl-$1" "sbcl"; \
} \
&& build_and_install_source() { \
cd "sbcl/" \
# 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 \
&& sh make.sh "--xc-host=${1}" --fancy $SBCL_MAKE_ARGS \
&& sh install.sh \
&& sh clean.sh \
&& cd /usr/local/src; \
} \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys ${SBCL_SIGNING_KEY} \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys ${DAEWOK_SIGNING_KEY} \
&& download_and_validate_hashes "$SBCL_BINARY_VERSION" \
&& download_and_validate_hashes "$SBCL_VERSION" \
&& download_and_unpack_binary "$SBCL_BINARY_VERSION" \
&& download_source "$SBCL_VERSION" \
&& 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 \
&& (cd "sbcl" && patch -p1 < ../static-executable-support.patch) \
&& rm static-executable-support.patch static-executable-support.patch.asc \
&& echo "\"$SBCL_VERSION-static-executable-v2\"" > sbcl/version.lisp-expr \
&& build_and_install_source "/usr/local/src/sbcl-${SBCL_BINARY_VERSION}-$SBCL_BINARY_ARCH_CODE-linux/run-sbcl.sh" \
&& rm -rf "$GNUPGHOME" "$SBCL_BINARY_VERSION-sum-file.txt" "$SBCL_VERSION-sum-file.txt" "sbcl-$SBCL_BINARY_VERSION-crhodes."* "sbcl-$SBCL_VERSION-crhodes."* "sbcl-$SBCL_VERSION-source.tar" "sbcl-$SBCL_BINARY_VERSION-$SBCL_BINARY_ARCH_CODE-linux" \
&& sbcl --version
# Add the Quicklisp installer.
WORKDIR /usr/local/share/common-lisp/source/quicklisp/
ENV QUICKLISP_SIGNING_KEY D7A3489DDEFE32B7D0E7CC61307965AB028B5FF7
RUN set -x \
&& curl -fsSL "https://beta.quicklisp.org/quicklisp.lisp" > quicklisp.lisp \
&& curl -fsSL "https://beta.quicklisp.org/quicklisp.lisp.asc" > quicklisp.lisp.asc \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "${QUICKLISP_SIGNING_KEY}" \
&& gpg --batch --verify "quicklisp.lisp.asc" "quicklisp.lisp" \
&& rm quicklisp.lisp.asc \
&& rm -rf "$GNUPGHOME"
# Add the script to trivially install Quicklisp
COPY install-quicklisp /usr/local/bin/install-quicklisp
# Install cl-launch. In the next release, move this up so that all images can
# share it.
# hadolint ignore=DL3008
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -y cl-launch \
&& rm -rf /var/lib/apt/lists/*
# Add the entrypoint
WORKDIR /
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["sbcl"]
#!/bin/sh
# If the first arg starts with a hyphen, prepend sbcl to arguments.
if [ "${1#-}" != "$1" ]; then
set -- sbcl "$@"
fi
exec "$@"
#!/bin/sh
if [ -z "$QUICKLISP_DIST_VERSION" ] || [ "$QUICKLISP_DIST_VERSION" = "latest" ]; then
QUICKLISP_DIST_VERSION=nil
else
QUICKLISP_DIST_VERSION="\"quicklisp/$QUICKLISP_DIST_VERSION\""
fi
if [ -z "$QUICKLISP_CLIENT_VERSION" ] || [ "$QUICKLISP_CLIENT_VERSION" = "latest" ]; then
QUICKLISP_CLIENT_VERSION=nil
else
QUICKLISP_CLIENT_VERSION="\"$QUICKLISP_CLIENT_VERSION\""
fi
sbcl --non-interactive \
--load /usr/local/share/common-lisp/source/quicklisp/quicklisp.lisp \
--eval "(quicklisp-quickstart:install :dist-version $QUICKLISP_DIST_VERSION :client-version $QUICKLISP_CLIENT_VERSION)" \
--eval "(when (equalp \"$QUICKLISP_ADD_TO_INIT_FILE\" \"true\") (ql-util:without-prompting (ql:add-to-init-file)))"
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM mcr.microsoft.com/windows/servercore:1809
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
ENV SBCL_VERSION 2.1.2
ENV SBCL_SOURCE_SHA256 b7710550939855ed49598c4a014483ed120b6991658a2a3b6afa47713dce4c0b
RUN echo 'Saving original machine PATH'; \
$machineKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\ControlSet001\Control\Session Manager\Environment\'); \
$machinePath = $machineKey.GetValue('PATH', [string]::Empty, 'DoNotExpandEnvironmentNames').ToString(); \
$machineKey.Close(); \
\
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
echo 'Installing choco'; \
Set-ExecutionPolicy Bypass -Scope Process -Force; \
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \
Import-Module 'C:\ProgramData\chocolatey\helpers\chocolateyProfile.psm1'; \
\
echo 'Installing unzip'; \
choco install -y unzip; \
\
echo 'Installing WIX. As of last check, dotnet35 is broken in chocolatey'; \
Invoke-WebRequest -Uri 'https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip' -OutFile wix311-binaries.zip; \
mkdir wix/bin; \
cd wix/bin; \
unzip ../../wix311-binaries.zip; \
cd ../../; \
rm wix311-binaries.zip; \
\
echo 'Installing SBCL 1.4.14'; \
Invoke-WebRequest -Uri 'https://github.com/sbcl/sbcl/raw/master/tools-for-build/sbcl.1.4.14.nupkg' -OutFile sbcl.1.4.14.nupkg; \
choco install -y sbcl --source .; \
refreshenv; \
sbcl --version; \
sbcl --eval '(print (+ 1 2))'; \
rm sbcl.1.4.14.nupkg; \
\
echo 'Installing msys2'; \
choco install -y msys2 --params '/NoUpdate' ; \
$env:PATH = ('C:\tools\msys64\usr\bin;c:\tools\msys64\mingw64\bin;{0}' -f $env:PATH); \
\
echo 'Installing build tools'; \
pacman -S --noconfirm --needed mingw-w64-x86_64-gcc make diffutils tar; \
\
echo 'Downloading SBCL source'; \
$sbclurl = ('https://downloads.sourceforge.net/project/sbcl/sbcl/{0}/sbcl-{0}-source.tar.bz2' -f $env:SBCL_VERSION); \
Invoke-WebRequest -Uri $sbclurl -OutFile sbcl-source.tar.bz2 -UserAgent "NativeHost"; \
$actualsha256 = (Get-FileHash sbcl-source.tar.bz2 -Algorithm sha256).Hash; \
Write-Host ('Verifying sha256 {0} (expected: {1})' -f $actualsha256, $env:SBCL_SOURCE_SHA256); \
if ($actualsha256 -ne $env:SBCL_SOURCE_SHA256) { \
Write-Host 'SHA256 check FAILED!'; \
exit 1; \
}; \
\
echo 'Unpacking source'; \
sh -c 'tar -x -v -f sbcl-source.tar.bz2'; \
rm sbcl-source.tar.bz2; \
\
echo 'Building SBCL'; \
$env:WIX = '/c/wix'; \
cd sbcl-$env:SBCL_VERSION; \
sh ./make.sh --with-sb-linkable-runtime; \
sh ./make-windows-installer.sh; \
cd ..; \
\
echo 'Removing WIX.'; \
rm -r wix; \
\
echo 'Removing msys2'; \
choco uninstall -y msys2; \
Remove-Item -Force -Recurse -Path C:\tools; \
\
echo 'Removing build SBCL'; \
choco uninstall -y sbcl; \
\
echo 'Removing chocolatey'; \
Remove-Item -Force -Recurse -Path C:\ProgramData\chocolatey; \
$machineKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\ControlSet001\Control\Session Manager\Environment\', $true); \
$machineKey.SetValue('PATH', $machinePath, 'ExpandString'); \
$machineKey.Close(); \
[Environment]::SetEnvironmentVariable('ChocolateyInstall', [string]::Empty, 'User'); \
[Environment]::SetEnvironmentVariable('ChocolateyInstall', [string]::Empty, 'Machine'); \
[Environment]::SetEnvironmentVariable('ChocolateyLastPathUpdate', [string]::Empty, 'User'); \
[Environment]::SetEnvironmentVariable('ChocolateyLastPathUpdate', [string]::Empty, 'Machine'); \
[Environment]::SetEnvironmentVariable('ChocolateyToolsLocation', [string]::Empty, 'User'); \
[Environment]::SetEnvironmentVariable('ChocolateyToolsLocation', [string]::Empty, 'Machine'); \
\
echo 'Installing SBCL'; \
cp C:\sbcl-$env:SBCL_VERSION\output\sbcl-$env:SBCL_VERSION-x86-64-windows-binary.msi sbcl-installer.msi; \
Start-Process msiexec.exe -Wait -ArgumentList '/I C:\sbcl-installer.msi'; \
echo 'Removing SBCL Source'; \
Remove-Item -Force -Recurse -Path C:\sbcl-$env:SBCL_VERSION; \
Remove-Item -Force -Path C:\sbcl-installer.msi;
CMD ["sbcl"]
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM mcr.microsoft.com/windows/servercore:ltsc2016
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
ENV SBCL_VERSION 2.1.2
ENV SBCL_SOURCE_SHA256 b7710550939855ed49598c4a014483ed120b6991658a2a3b6afa47713dce4c0b
RUN echo 'Saving original machine PATH'; \
$machineKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\ControlSet001\Control\Session Manager\Environment\'); \
$machinePath = $machineKey.GetValue('PATH', [string]::Empty, 'DoNotExpandEnvironmentNames').ToString(); \
$machineKey.Close(); \
\
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
echo 'Installing choco'; \
Set-ExecutionPolicy Bypass -Scope Process -Force; \
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \
Import-Module 'C:\ProgramData\chocolatey\helpers\chocolateyProfile.psm1'; \
\
echo 'Installing unzip'; \
choco install -y unzip; \
\
echo 'Installing WIX. As of last check, dotnet35 is broken in chocolatey'; \
Invoke-WebRequest -Uri 'https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip' -OutFile wix311-binaries.zip; \
mkdir wix/bin; \
cd wix/bin; \
unzip ../../wix311-binaries.zip; \
cd ../../; \
rm wix311-binaries.zip; \
\
echo 'Installing SBCL 1.4.14'; \
Invoke-WebRequest -Uri 'https://github.com/sbcl/sbcl/raw/master/tools-for-build/sbcl.1.4.14.nupkg' -OutFile sbcl.1.4.14.nupkg; \
choco install -y sbcl --source .; \
refreshenv; \
sbcl --version; \
sbcl --eval '(print (+ 1 2))'; \
rm sbcl.1.4.14.nupkg; \
\
echo 'Installing msys2'; \
choco install -y msys2 --params '/NoUpdate' ; \
$env:PATH = ('C:\tools\msys64\usr\bin;c:\tools\msys64\mingw64\bin;{0}' -f $env:PATH); \
\
echo 'Installing build tools'; \
pacman -S --noconfirm --needed mingw-w64-x86_64-gcc make diffutils tar; \
\
echo 'Downloading SBCL source'; \
$sbclurl = ('https://downloads.sourceforge.net/project/sbcl/sbcl/{0}/sbcl-{0}-source.tar.bz2' -f $env:SBCL_VERSION); \
Invoke-WebRequest -Uri $sbclurl -OutFile sbcl-source.tar.bz2 -UserAgent "NativeHost"; \
$actualsha256 = (Get-FileHash sbcl-source.tar.bz2 -Algorithm sha256).Hash; \
Write-Host ('Verifying sha256 {0} (expected: {1})' -f $actualsha256, $env:SBCL_SOURCE_SHA256); \
if ($actualsha256 -ne $env:SBCL_SOURCE_SHA256) { \
Write-Host 'SHA256 check FAILED!'; \
exit 1; \
}; \
\
echo 'Unpacking source'; \
sh -c 'tar -x -v -f sbcl-source.tar.bz2'; \
rm sbcl-source.tar.bz2; \
\
echo 'Building SBCL'; \
$env:WIX = '/c/wix'; \
cd sbcl-$env:SBCL_VERSION; \
sh ./make.sh --with-sb-linkable-runtime; \
sh ./make-windows-installer.sh; \
cd ..; \
\
echo 'Removing WIX.'; \
rm -r wix; \
\
echo 'Removing msys2'; \
choco uninstall -y msys2; \
Remove-Item -Force -Recurse -Path C:\tools; \
\
echo 'Removing build SBCL'; \
choco uninstall -y sbcl; \
\
echo 'Removing chocolatey'; \
Remove-Item -Force -Recurse -Path C:\ProgramData\chocolatey; \
$machineKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\ControlSet001\Control\Session Manager\Environment\', $true); \
$machineKey.SetValue('PATH', $machinePath, 'ExpandString'); \
$machineKey.Close(); \
[Environment]::SetEnvironmentVariable('ChocolateyInstall', [string]::Empty, 'User'); \
[Environment]::SetEnvironmentVariable('ChocolateyInstall', [string]::Empty, 'Machine'); \
[Environment]::SetEnvironmentVariable('ChocolateyLastPathUpdate', [string]::Empty, 'User'); \
[Environment]::SetEnvironmentVariable('ChocolateyLastPathUpdate', [string]::Empty, 'Machine'); \
[Environment]::SetEnvironmentVariable('ChocolateyToolsLocation', [string]::Empty, 'User'); \
[Environment]::SetEnvironmentVariable('ChocolateyToolsLocation', [string]::Empty, 'Machine'); \
\
echo 'Installing SBCL'; \
cp C:\sbcl-$env:SBCL_VERSION\output\sbcl-$env:SBCL_VERSION-x86-64-windows-binary.msi sbcl-installer.msi; \
Start-Process msiexec.exe -Wait -ArgumentList '/I C:\sbcl-installer.msi'; \
echo 'Removing SBCL Source'; \
Remove-Item -Force -Recurse -Path C:\sbcl-$env:SBCL_VERSION; \
Remove-Item -Force -Path C:\sbcl-installer.msi;
CMD ["sbcl"]
FROM PLACEHOLDER
ENV SBCL_VERSION PLACEHOLDER
ENV SBCL_SIGNING_KEY D6839CA0A67F74D9DFB70922EBD595A9100D63CD
ENV DAEWOK_SIGNING_KEY 823DF61DEDB633B3DE7B2B7C181191EF9ACF6934
WORKDIR /usr/local/src/
# hadolint ignore=DL3003,DL3018
RUN set -x \
&& case "$(cat /etc/apk/arch)" in \
# We can't build --with-sb-prelink-linkage-table on armv7 because of
# how musl has implemented time64 support...
armv7) SBCL_ARCH=arm; SBCL_MAKE_ARGS="--with-sb-linkable-runtime";; \
aarch64) SBCL_ARCH=arm64; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
x86_64) SBCL_ARCH=x86-64; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
*) echo "Unknown arch" >&2; exit 1;; \
esac \
&& export SBCL_ARCH \
&& import_key() { \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$1"; \
} \
&& 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_source() { \
url="https://downloads.sourceforge.net/project/sbcl/sbcl/${1}/sbcl-${1}-source.tar.bz2" \
&& curl -fsSL "$url" > "sbcl-${1}-source.tar.bz2" \
&& bunzip2 "sbcl-${1}-source.tar.bz2" \
&& grep "sbcl-${1}-source.tar" "sbcl-${1}-crhodes.txt" > "${1}-sum-file.txt" \
&& sha256sum -c "${1}-sum-file.txt" \
&& tar xf "sbcl-${1}-source.tar"; \
} \
&& build_and_install_source() { \
cd "sbcl-${1}/" \
# 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 \
&& sh make.sh $SBCL_MAKE_ARGS \
&& sh install.sh \
&& cd /usr/local/src; \
} \
&& apk add --no-cache ca-certificates curl openssl make gcc musl-dev linux-headers gnupg patch \
&& apk add --no-cache sbcl --repository http://dl-3.alpinelinux.org/alpine/edge/community/ \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& import_key "$SBCL_SIGNING_KEY" \
&& import_key "$DAEWOK_SIGNING_KEY" \
&& download_and_validate_hashes "$SBCL_VERSION" \
&& download_source "$SBCL_VERSION" \
&& 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 \
&& (cd "sbcl-$SBCL_VERSION" && patch -p1 < ../static-executable-support.patch) \
&& rm static-executable-support.patch static-executable-support.patch.asc \
&& echo "\"$SBCL_VERSION-static-executable-v2\"" > sbcl-$SBCL_VERSION/version.lisp-expr \
&& build_and_install_source "$SBCL_VERSION" \
&& apk del --no-cache ca-certificates curl openssl make gcc musl-dev linux-headers gnupg sbcl patch \
&& pkill -9 gpg-agent \
&& pkill -9 dirmngr \
&& rm -rf "$GNUPGHOME" ./* \
&& sbcl --version
WORKDIR /
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["sbcl"]
FROM PLACEHOLDER
ENV SBCL_VERSION PLACEHOLDER
ENV SBCL_SIGNING_KEY D6839CA0A67F74D9DFB70922EBD595A9100D63CD
ENV DAEWOK_SIGNING_KEY 823DF61DEDB633B3DE7B2B7C181191EF9ACF6934
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; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
arm64) SBCL_ARCH=arm64; SBCL_BINARY_ARCH_CODE=arm64; SBCL_BINARY_VERSION=1.4.2; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
# 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; SBCL_MAKE_ARGS="--with-sb-linkable-runtime --with-sb-prelink-linkage-table";; \
*) 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://downloads.sourceforge.net/project/sbcl/sbcl/${1}/sbcl-${1}-source.tar.bz2" \
&& curl -fsSL "$url" > "sbcl-${1}-source.tar.bz2" \
&& bunzip2 "sbcl-${1}-source.tar.bz2" \
&& grep "sbcl-${1}-source.tar" "sbcl-${1}-crhodes.txt" > "${1}-sum-file.txt" \
&& sha256sum -c "${1}-sum-file.txt" \
&& tar xf "sbcl-${1}-source.tar" \
&& mv "sbcl-$1" "sbcl"; \
} \
&& build_and_install_source() { \
cd "sbcl/" \
# 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 \
&& sh make.sh "--xc-host=${1}" --fancy $SBCL_MAKE_ARGS \
&& sh install.sh \
&& sh clean.sh \
&& cd /usr/local/src; \
} \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys ${SBCL_SIGNING_KEY} \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys ${DAEWOK_SIGNING_KEY} \
&& download_and_validate_hashes "$SBCL_BINARY_VERSION" \
&& download_and_validate_hashes "$SBCL_VERSION" \
&& download_and_unpack_binary "$SBCL_BINARY_VERSION" \
&& download_source "$SBCL_VERSION" \
&& 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 \
&& (cd "sbcl" && patch -p1 < ../static-executable-support.patch) \
&& rm static-executable-support.patch static-executable-support.patch.asc \
&& echo "\"$SBCL_VERSION-static-executable-v2\"" > sbcl/version.lisp-expr \
&& build_and_install_source "/usr/local/src/sbcl-${SBCL_BINARY_VERSION}-$SBCL_BINARY_ARCH_CODE-linux/run-sbcl.sh" \
&& rm -rf "$GNUPGHOME" "$SBCL_BINARY_VERSION-sum-file.txt" "$SBCL_VERSION-sum-file.txt" "sbcl-$SBCL_BINARY_VERSION-crhodes."* "sbcl-$SBCL_VERSION-crhodes."* "sbcl-$SBCL_VERSION-source.tar" "sbcl-$SBCL_BINARY_VERSION-$SBCL_BINARY_ARCH_CODE-linux" \
&& sbcl --version
# Add the Quicklisp installer.
WORKDIR /usr/local/share/common-lisp/source/quicklisp/
ENV QUICKLISP_SIGNING_KEY D7A3489DDEFE32B7D0E7CC61307965AB028B5FF7
RUN set -x \
&& curl -fsSL "https://beta.quicklisp.org/quicklisp.lisp" > quicklisp.lisp \
&& curl -fsSL "https://beta.quicklisp.org/quicklisp.lisp.asc" > quicklisp.lisp.asc \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "${QUICKLISP_SIGNING_KEY}" \
&& gpg --batch --verify "quicklisp.lisp.asc" "quicklisp.lisp" \
&& rm quicklisp.lisp.asc \
&& rm -rf "$GNUPGHOME"
# Add the script to trivially install Quicklisp
COPY install-quicklisp /usr/local/bin/install-quicklisp
# Install cl-launch. In the next release, move this up so that all images can