32 lines
858 B
Docker
32 lines
858 B
Docker
# docker build -t ml:latest .
|
|
# docker run --rm -it ml ml -v
|
|
# docker run --rm -it --entrypoint sh ml
|
|
|
|
|
|
FROM alpine:3.15.4 AS builder
|
|
|
|
# Install all dependencies required for compiling ml
|
|
RUN apk add --verbose build-base musl-dev openssl-dev make git cmake
|
|
|
|
RUN git clone http://gitea.stocksriddle.one/vaclavt/mlisp.git
|
|
|
|
# Compile
|
|
RUN cd /mlisp \
|
|
&& rm -f CMakeCache.txt \
|
|
&& cmake -DCMAKE_BUILD_TYPE=Release . \
|
|
&& cmake --build ./ --target clean -j 4 -- \
|
|
&& cmake --build ./ --target all -j 4 --
|
|
|
|
|
|
# Create image and copy compiled installation into it
|
|
FROM alpine:3.15.4
|
|
|
|
RUN apk add --no-cache openssl libstdc++
|
|
|
|
CMD mkdir -p /usr/local/var/mlisp/
|
|
COPY --from=builder /mlisp/stdlib/*.lsp /usr/local/var/mlisp/
|
|
COPY --from=builder /mlisp/doc/*.md /usr/local/var/mlisp/
|
|
|
|
CMD mkdir -p /usr/local/bin/
|
|
COPY --from=builder /mlisp/ml /usr/local/bin/
|