-
-
Save keesterbrugge/6ed71e8ee44c93f8be1c51b01b85cac8 to your computer and use it in GitHub Desktop.
Revisions
-
cellularmitosis revised this gist
Sep 2, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,10 @@ Blog 2019/7/18 [<- previous](https://gist.github.com/cellularmitosis/91f654aca6500eb1c8408768486e19b8) | [index](https://gist.github.com/cellularmitosis/1106b185f8b34ae0e36afa5fbcd04a00) | [next ->](https://gist.github.com/cellularmitosis/5c1011b4199bfb3920ad9b06dbf2277f) # "Hello, world" in Clojure compiled with GraalVM running in Docker Create a new minimal Clojure project using leiningen: -
cellularmitosis revised this gist
Sep 2, 2019 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ [<- previous](https://gist.github.com/cellularmitosis/91f654aca6500eb1c8408768486e19b8) | [index](https://gist.github.com/cellularmitosis/1106b185f8b34ae0e36afa5fbcd04a00) | [next ->](https://gist.github.com/cellularmitosis/5c1011b4199bfb3920ad9b06dbf2277f) # Blog 2019/7/18: "Hello, world" in Clojure compiled with GraalVM running in Docker Create a new minimal Clojure project using leiningen: -
cellularmitosis revised this gist
Jul 18, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # "Hello, world" in Clojure compiled with GraalVM running in Docker Create a new minimal Clojure project using leiningen: -
cellularmitosis created this gist
Jul 18, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,59 @@ # "Hello, world" in Clojure compiled with GrallVM running in Docker Create a new minimal Clojure project using leiningen: ``` $ lein new minimal hello $ cd hello ``` Edit `project.clj` to look like this: ```clojure (defproject hello "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.10.0"]] :profiles {:dev {:dependencies [[org.clojure/test.check "0.9.0"]]}} :main hello.core) ``` Edit `src/hello/core.clj` to look like this: ```clojure (ns hello.core (:gen-class)) (defn -main [] (println "Hello, clombda!")) ``` According to [this](https://github.com/uwcpdx/clombda/blob/master/README.md) you also need to run this: ``` $ lein change :main set hello.core ``` Build a native image: ``` $ docker run --rm "-v$(pwd):/clj" "-v${HOME}/.m2:/root/.m2" spieden/clombda:latest ``` Create a Dockerfile: ``` FROM renanpalmeira/graalvm-alpine COPY target/clombda/package/clj-native /root/ CMD ["/root/clj-native"] ``` Build a docker image: ``` $ docker build -t hello . ``` Run it: ``` $ docker run hello Hello, clombda! ```