Skip to content

Commit

Permalink
Auto-update ccl (#82)
Browse files Browse the repository at this point in the history
* Auto-update ccl.

* Fix ccl/Dockerfile to rebuild CCL.

Because the binary works only with glibc 2.32-2.34, but Debian Bullseye doens't have the package.

---------

Co-authored-by: fukamachi <[email protected]>
Co-authored-by: Eitaro Fukamachi <[email protected]>
  • Loading branch information
3 people authored Aug 12, 2023
1 parent 5826a97 commit b4ab834
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 16 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
15 changes: 9 additions & 6 deletions ccl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
```
$ docker pull fukamachi/ccl
$ docker run -it --rm fukamachi/ccl
$ docker pull fukamachi/ccl:1.12
$ docker run -it --rm fukamachi/ccl:1.12
$ docker pull fukamachi/ccl:1.12.1
$ docker run -it --rm fukamachi/ccl:1.12.1
```

## Supported tags

- `1.12.1`, `1.12.1-debian`, `latest`, `latest-debian`
- `1.12.1-ubuntu`, `latest-ubuntu`
- `1.12.1-alpine`, `latest-alpine`
- `1.12.2`, `1.12.2-debian`, `latest`, `latest-debian`
- `1.12.2-ubuntu`, `latest-ubuntu`
- `1.12.2-alpine`, `latest-alpine`
- `1.12.1`, `1.12.1-debian`
- `1.12.1-alpine`
- `1.12.1-ubuntu`
- `1.12`, `1.12-debian`
- `1.12-alpine`
- `1.12-ubuntu`
Expand All @@ -33,5 +36,5 @@ $ docker run -it --rm fukamachi/ccl:1.12
## Building by your own

```
$ docker build -t ccl:1.12 --build-arg VERSION=1.12 ccl/debian/
$ docker build -t ccl:1.12.1 --build-arg VERSION=1.12.1 ccl/debian/
```
1 change: 1 addition & 0 deletions ccl/versions
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
1.11.5,19.12.13.103
1.12,20.04.14.105
1.12.1,21.06.14.110
1.12.2,22.12.14.113

0 comments on commit b4ab834

Please sign in to comment.