Open skydread1 opened 6 months ago
load-var
core/entry-point
core/default-entry-point
:entry-point
entry-point
For example, a project might want to have some env var passed down and a specify the shell like so:
(ns jibbit (:require [jibbit.core :as jibbit])) (defn my-entry-point [{:keys [basis main working-dir]}] (->> (concat ["java ${JAVA_OPTS} -Dclojure.main.report=stderr -Dfile.encoding=UTF-8"] (concat ["-cp" (jibbit/container-cp basis working-dir) "clojure.main"] (if-let [main-opts (-> basis :argmap :main-opts)] main-opts ["-m" (pr-str main)]))) (interpose " ") (apply str) (conj ["/bin/sh" "-c"])))
Then, this implementation can be specified in the jib.edn for instance:
jib.edn
{:main my.app.core :user "root" :group "root" :base-image {:image-name "openjdk:11-slim-buster" :type :registry} :target-image {:image-name "props-reco/test" :type :docker :tag "test"} :entry-point jibbit/my.entry-point}
Closes #23
changes
load-var
util function to resolve a given symbolcore/entry-point
tocore/default-entry-point
for clarity:entry-point
symbol in the jib config with his own implementation ofentry-point
.Example of use case
For example, a project might want to have some env var passed down and a specify the shell like so:
Then, this implementation can be specified in the
jib.edn
for instance: