forked from theasp/docker-clojurescript-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-lein
43 lines (39 loc) · 2.05 KB
/
Dockerfile-lein
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM node:latest
MAINTAINER Andrew Phillips <[email protected]>
WORKDIR /tmp
ENV LEIN_VERSION=2.9.1 \
LEIN_INSTALL=/usr/local/bin/ \
LEIN_SHA=a4c239b407576f94e2fef5bfa107f0d3f97d0b19c253b08860d9609df4ab8b29 \
LEIN_GPG_KEY=2B72BF956E23DE5E830D50F6002AF007D1A7CC18 \
PATH=$PATH:$LEIN_INSTALL \
LEIN_ROOT=1 \
CLOJURE_VER=1.10.3.933 \
CLOJURESCRIPT_VER=1.10.866
# Download the whole repo as an archive
RUN set -ex; \
mkdir -p $LEIN_INSTALL; \
wget -q https://github.com/technomancy/leiningen/archive/$LEIN_VERSION.tar.gz; \
echo "$LEIN_SHA *$LEIN_VERSION.tar.gz" | sha256sum -c -; \
mkdir ./leiningen; \
tar -xzf $LEIN_VERSION.tar.gz -C ./leiningen/ --strip-components=1; \
mv leiningen/bin/lein-pkg $LEIN_INSTALL/lein; \
rm -rf $LEIN_VERSION.tar.gz ./leiningen; \
chmod 0755 $LEIN_INSTALL/lein; \
# Download and verify Lein stand-alone jar
wget -q https://github.com/technomancy/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.zip; \
# wget -q https://github.com/technomancy/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.zip.asc; \
# gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-key $LEIN_GPG_KEY; \
# gpg --verify leiningen-$LEIN_VERSION-standalone.zip.asc; \
# Put the jar where lein script expects
rm -f leiningen-$LEIN_VERSION-standalone.zip.asc; \
mkdir -p /usr/share/java; \
mv leiningen-$LEIN_VERSION-standalone.zip /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar; \
apt-get update; \
apt-get -q -y install openjdk-11-jdk; \
curl -s https://download.clojure.org/install/linux-install-$CLOJURE_VER.sh | bash
# Install latest Clojure and ClojureScript so users don't have to download it every time
RUN set -ex; \
echo "(defproject dummy \"\" :plugins [[lein-ancient \"0.6.15\"][lein-npm \"0.6.2\"][lein-cljsbuild \"1.1.7\"]] :dependencies [[org.clojure/clojure \"${CLOJURE_VER%.*}\"][org.clojure/clojurescript \"${CLOJURESCRIPT_VER}\"]])" > project.clj; \
lein ancient upgrade :check-clojure; \
lein do deps, npm install; \
rm -f project.clj