commit 855ecbbe316bc29a22258fdda67faccd868cb7e0
parent 0dcbef862a5cac6b57aeeb53e85c48606de3968c
Author: Risto Stevcev <me@risto.codes>
Date: Sun, 27 Jun 2021 01:23:34 +0200
Added makeself single binary implementation
Diffstat:
5 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -1,4 +1,4 @@
.PHONY: default
default:
- tar cf micropm.tar micropm-docker/ micropm-get .envrc
+ makeself micropm micropm-get "Cl-micropm" ./micropm-get.sh
diff --git a/micropm/.envrc b/micropm/.envrc
@@ -0,0 +1 @@
+export CL_SOURCE_REGISTRY="$PWD/lisp-systems//"
diff --git a/micropm/micropm-docker/Dockerfile b/micropm/micropm-docker/Dockerfile
@@ -0,0 +1,27 @@
+FROM debian:bullseye-slim
+
+ARG SYSTEM_NAME
+ENV SYSTEM_NAME=${SYSTEM_NAME}
+
+RUN apt-get update && apt-get install -y sbcl curl gnupg
+RUN useradd -ms /bin/bash lisp
+USER lisp
+WORKDIR /home/lisp
+
+RUN curl -O https://beta.quicklisp.org/quicklisp.lisp
+RUN curl -O https://beta.quicklisp.org/quicklisp.lisp.asc
+RUN curl -O https://beta.quicklisp.org/release-key.txt
+RUN gpg --import release-key.txt
+RUN gpg --verify quicklisp.lisp.asc quicklisp.lisp
+
+
+RUN sbcl --non-interactive \
+ --load quicklisp.lisp \
+ --eval '(quicklisp-quickstart:install)' \
+ --eval '(ql::without-prompting (ql:add-to-init-file))'
+
+COPY . /home/lisp/common-lisp/${SYSTEM_NAME}/
+RUN ls /home/lisp/common-lisp/${SYSTEM_NAME}
+
+RUN sbcl --non-interactive --eval '(ql:quickload (sb-ext:posix-getenv "SYSTEM_NAME"))'
+CMD bash
diff --git a/micropm-get b/micropm/micropm-get
diff --git a/micropm/micropm-get.sh b/micropm/micropm-get.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+SYSTEM_NAME=$1
+
+docker build -f ./micropm-docker/Dockerfile "$USER_PWD" --rm -t "$SYSTEM_NAME" --build-arg SYSTEM_NAME="$SYSTEM_NAME"
+docker create --name "$SYSTEM_NAME" "$SYSTEM_NAME" bash
+docker cp "$SYSTEM_NAME":/home/lisp/quicklisp/dists/quicklisp/software/ lisp-systems/
+docker rm "$SYSTEM_NAME"
+docker rmi "$SYSTEM_NAME"
+
+cp -r lisp-systems/ "$USER_PWD"
+cp .envrc "$USER_PWD"