Skip to content

Commit

Permalink
Fix ccl/Dockerfile to rebuild CCL.
Browse files Browse the repository at this point in the history
Because the binary works only with glibc 2.32-2.34, but Debian Bullseye doens't have the package.
  • Loading branch information
fukamachi committed Aug 12, 2023
1 parent 0628085 commit 90917be
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions ccl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
ARG ROSWELL_IMAGE=fukamachi/roswell
ARG ROSWELL_VERSION
ARG OS=debian

FROM fukamachi/roswell:latest-$OS AS build-env

ARG OS
ARG VERSION

ADD https://github.com/roswell/ccl_bin/releases/download/$VERSION/ccl-$VERSION-linuxx86.tar.gz ccl.tar.gz

# hadolint ignore=SC2010,DL3003,DL3008,DL4006
RUN set -x; \
if [ "$OS" = "alpine" ]; then \
ros install ccl-bin; \
else \
apt-get update && apt-get -y install --no-install-recommends build-essential m4; \
ros install sbcl-bin && \
tar xvfz ccl.tar.gz && rm ccl.tar.gz && \
mkdir /root/.roswell/impls/x86-64/linux/ccl-bin && mv ccl "/root/.roswell/impls/x86-64/linux/ccl-bin/$VERSION"; \
(cd "/root/.roswell/impls/x86-64/linux/ccl-bin/$VERSION/lisp-kernel/linuxx8664" || exit 1) && make && (cd /root || exit 1); \
fi; \
ls "/root/.roswell/impls/x86-64/linux/ccl-bin/$VERSION" | grep -v -E "lx86cl64|lx86cl64.image" | xargs rm -rf && \
rm -rf /root/.roswell/impls/log

FROM $ROSWELL_IMAGE:$ROSWELL_VERSION-$OS

ARG BUILD_DATE
ARG VCS_REF
ARG OS
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/fukamachi/dockerfiles" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"

# hadolint ignore=DL3010
COPY --from=build-env /root/.roswell/impls /root/.roswell/impls

RUN set -x; \
ros install sbcl-bin && \
ros install "ccl-bin/${VERSION}" \
&& ros use "ccl-bin/${VERSION}" \
# Uninstall unnecessary files
&& ros -e '(ql:uninstall-dist "quicklisp")' -e '(ql-dist:install-dist "http://beta.quicklisp.org/dist/quicklisp.txt" :prompt nil)' \
&& rm -rf /root/.roswell/archives/* \
/root/.roswell/src/sbcl-* \
/root/.roswell/src/ccl-* \
/root/.roswell/lisp/quicklisp/tmp/quicklisp.tar \
/root/.cache/common-lisp/sbcl-*/root/.roswell/lisp/quicklisp/dists/quicklisp/software
printf "setup.time\t0\t%s\n" "$(( $(date +%s) + 2208988800 ))" > ~/.roswell/config && \
printf "sbcl-bin.version\t0\t%s\n" "$(ls /root/.roswell/impls/x86-64/linux/sbcl-bin)" >> ~/.roswell/config && \
printf "ccl-bin.version\t0\t%s\n" "$VERSION" >> ~/.roswell/config && \
printf "default.lisp\t0\tccl-bin\n" >> ~/.roswell/config && \
ros setup && \
ros -e '(mapc (function ql-dist:uninstall) (ql-dist:installed-releases t))' \
&& rm -f /root/.roswell/lisp/quicklisp/tmp/quicklisp.tar \
&& rm -rf /root/.roswell/archives/* /root/.roswell/src/sbcl-* /root/.cache/common-lisp/sbcl-*/root/.roswell/lisp/quicklisp/dists/quicklisp/software

RUN set -x; \
printf '#!/bin/sh\nexec ros run -- "$@"\n' > /usr/local/bin/ccl \
Expand Down

0 comments on commit 90917be

Please sign in to comment.