Tag: compojure

如何让Clojure Compojure应用程序通过Docker容器中的编译jar运行无头?

更新 :这个问题已经改变,因为最初的一组评论者留下了回应。 对任何混淆道歉。 这是我的代码库https://github.com/Integralist/spurious-clojure-example你可以用它作为我正在使用的例子。 请注意,上面的回购依赖于我还没有发布到Clojars的库(因为我还在testing它 – 因此打开了这个问题)。 你可以在这里看到库的源代码: https : //github.com/Integralist/spurious-clojure-aws-sdk-helper 我有一个用Compojure编写的“hello world”Clojurenetworking应用程序,当使用lein ring server lein run并lein run (因为我现在创build了一个-main函数),我工作的很好。 当编译成jar时,它也运行到一定程度,我运行java -jar app.jar 。 我现在的问题是,如果我尝试从Docker容器中运行默认的java -jar app.jar ,我得到以下错误告诉我… spurious-clojure-example is starting 2015-02-14 00:58:03.812:INFO:oejs.Server:jetty-7.xy-SNAPSHOT 2015-02-14 00:58:03.854:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080 Started server on port 8080 Exception in thread "main" java.awt.HeadlessException: 我的代码目前正在使用一个-main函数就像这样… (ns spurious-clojure-example.repl (:use spurious-clojure-example.handler ring.server.standalone [ring.middleware file-info file]) (:gen-class)) […]