changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > demo / Dockerfile

changeset 20: 3166a511fafb
child: ba323d8c0f93
author: ellis <ellis@rwest.io>
date: Sat, 03 Jun 2023 19:57:10 -0400
permissions: -rw-r--r--
description: notes and dockerfile init
1 ARG ROSWELL_IMAGE=fukamachi/roswell
2 ARG ROSWELL_VERSION
3 ARG OS=debian
4 FROM fukamachi/roswell:latest-$OS AS build-env
5 ARG OS
6 ARG VERSION
7 ADD https://github.com/sbcl/sbcl/archive/sbcl-$VERSION.tar.gz sbcl.tar.gz
8 
9 RUN set -x; \
10  arch="$(case $(uname -m) in amd64|x86_64) echo x86-64;; aarch64) echo arm64;; *) uname -m ;; esac)"; \
11  if [ "$OS" = "alpine" ]; then \
12  apk add --update build-base linux-headers zstd-dev; \
13  else \
14  apt-get update && apt-get -y install --no-install-recommends \
15  build-essential \
16  zlib1g-dev \
17  libzstd-dev \
18  time; \
19  fi; \
20  ros install sbcl-bin/2.2.7 && \
21  tar xvfz sbcl.tar.gz && rm sbcl.tar.gz && cd "sbcl-sbcl-${VERSION}" && \
22  echo "\"$VERSION\"" > version.lisp-expr && \
23  (sh make.sh \
24  --with-sb-core-compression \
25  "--xc-host=ros -L sbcl-bin without-roswell=t --no-rc run" \
26  "--prefix=$HOME/.roswell/impls/$arch/linux/sbcl-bin/$VERSION/" || true) \
27  && sh install.sh && \
28  rm -f "/root/.roswell/impls/$arch/linux/sbcl-bin/$VERSION/lib/sbcl/sbcl.core.old" \
29  && rm -f "/root/.roswell/impls/$arch/linux/sbcl-bin/$VERSION/bin/sbcl.old" \
30  && find "/root/.roswell/impls/$arch/linux/sbcl-bin" -maxdepth 1 -mindepth 1 | grep -v "/sbcl-bin/$VERSION$" | xargs rm -rf || true \
31  && rm -rf "/root/.roswell/impls/log"
32 
33 FROM $ROSWELL_IMAGE:$ROSWELL_VERSION-$OS
34 # hadolint ignore=DL3010
35 COPY --from=build-env /root/.roswell/impls /root/.roswell/impls
36 
37 ARG BUILD_DATE
38 ARG VCS_REF
39 ARG OS
40 ARG VERSION
41 
42 LABEL org.label-schema.build-date=$BUILD_DATE \
43  org.label-schema.vcs-ref=$VCS_REF \
44  org.label-schema.vcs-url="https://github.com/fukamachi/dockerfiles" \
45  org.label-schema.version=$VERSION \
46  org.label-schema.schema-version="1.0"
47 
48 # hadolint ignore=DL3018
49 RUN set -x; \
50  if [ "$OS" = "alpine" ]; then \
51  apk add --update --no-cache zstd-libs; \
52  fi; \
53  printf "setup.time\t0\t%s\n" "$(( $(date +%s) + 2208988800 ))" > ~/.roswell/config && \
54  printf "sbcl-bin.version\t0\t%s\n" "$VERSION" >> ~/.roswell/config && \
55  printf "default.lisp\t0\tsbcl-bin\n" >> ~/.roswell/config && \
56  ros setup && \
57  ros -e '(mapc (function ql-dist:uninstall) (ql-dist:installed-releases t))' \
58  && rm -f /root/.roswell/lisp/quicklisp/tmp/quicklisp.tar \
59  && rm -rf /root/.roswell/archives/* /root/.roswell/src/sbcl-* /root/.cache/common-lisp/sbcl-*/root/.roswell/lisp/quicklisp/dists/quicklisp/software
60 
61 RUN set -x; \
62  printf '#!/bin/sh\nexec ros run -- "$@"\n' > /usr/local/bin/sbcl \
63  && chmod u+x /usr/local/bin/sbcl
64 
65 ENTRYPOINT ["/usr/local/bin/sbcl"]