GithubHelp home page GithubHelp logo

jibbit's People

Contributors

danieroux avatar dockeragent2 avatar kennyjwilli avatar lambdank avatar loganlinn avatar slimslenderslacks avatar willmruzek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jibbit's Issues

Question:

Is there a way to have multiple targets? Say one for when running locally and another that pushes to remote registry.

support allowInsecureRegistries

gradle/maven jib have a flag to allowInsecureRegistries which is useful in certain environments.

Can jibbit be made to support a similar config?

On windows, classpath in image uses backslash as file separator

When jibbit is used from windows, the classpaths used in the image will have backslashes instead of slashes in the file paths. This yields the following error when the image is run:

Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main

I believe that the problem is this line:

(map :from-working-dir)

If I replace :from-working-dir there with :docker-path things work as expected.

I can provide a pull request if you'd like.

Repository is missing main branch

Github showing this repository as not having any branches. Is this intentional?

$ git ls-remote --heads https://github.com/atomisthq/jibbit.git

Last known commit appears to be from #20 (b052382)

aot does not work correctly due to outdated tools.build

Have been trying out jibbit and there are various strange behaviours

jibbit: 0.1.13
tools.build: 0.7.5

Does not work without :aot

  • The docs indicate :aotis optional, but if I don't provide it, it fails with

Cannot invoke"java.nio.file.Path.getFileSystem()" because "path" is null (clojure-app-layers)

Class files are not included in the jar when using :aot

  • Providing a main class with (:gen-class) and using the :aot flag, the app.jar in the resulting docker image does not have any class files
  • this means running the docker image fails with

could not find or load main class <my.main.class>

I've spent time debugging the 2nd issue and it seems to be due to using tools.build 0.7.5, where src-dirs must be provided explicit as they are not inferred from the basis (aka paths in deps.edn). I can confirm that using tools.build 0.8.1 directly, the compile-clj function generates the class files correctly even without specifying src-dirs (which is how jibbit uses it).

Alternatively, allowing src-paths to be provided as an arg could work around it, though is a bit ugly.

main-opts and jvm-opts are being extracted from basis incorrectly

In doing some work on the basis recently, I discovered that due to some sloppy coding on my part, the basis contained more data than it should have in the :resolve-args and :classpath-args keys.

In particular these code locations are pulling either :jvm-opts or :main-opts from the :classpath-args map. Neither of these are classpath args and were never expected to be data that should be there:

So, you should not be doing that. However, I do think it is reasonable to want those merged jvm-opts and main-opts and the basis now contains an official place to get that info in a new basis key :argmap.

To fix, update to at least tools.build 0.9.4, and replace :classpath-args with :argmap. The :classpath-args are deprecated and will be removed in the near future.

How to use an uberjar created via a tools.build build program

Hello,
First of all, thank you for the great work you are doing with jibbit! Very much appreciated!

Is there any way I can use an uberjar created by my tools.build program to create the container image? I am currently generating some custom files before building the uberjar and I would like to have those files in the JAR used to create the image.

Thank you!

Support local/root / polylith projects

Discussed on slack with @slimslenderslacks but thought I would raise an issue so its not forgotten.

If you use a code base in the polylith format the generated container is incomplete.

There is an example project here
https://github.com/furkan3ayraktar/clojure-polylith-realworld-example-app/tree/master/projects/realworld-backend

The cause of the issues is that polylith uses local/root and often relative paths so the components do not get picked up and included in the final build.

jibbit seem to ignore custom paths in deps.edn - how can I provide my own JAR?

Hi!

My project uses non-default source and resource paths (created with command mkdir -p {dev,main,test}/{src,resources}) and it seems that when following instructions naïvely from the project README, the resulting layer has main/src and main/resources prefixes for the relevant files, instead of correct roots, which of course leads to non-existent main ns being loaded, a stacktrace and exit.

Can I provide my own JAR instead, and if so, what should the build script for it be? Eg. tools.build

There is no way to provide `$JAVA_OPTS` in the default `entrypoint`

Problem

In entry-point, the following is used for the entrypoint:

["java" "-Dclojure.main.report=stderr" "-Dfile.encoding=UTF-8"] and the -cp and -m args are concatenated to it.

It is common to start an app with custom JAVA_OPTS.

In the current implementation, the only way to do so seems to provide a custom entrypoint script such as:

java $JAVA_OPTS -cp ... clojure.main -m my.app.core

But providing the value of -cp is not ideal as it can be very long since jibbit does not provide a way to generate a uberjar.

Suggestion

In my case I would like entry-point to look like this for instance:

(defn entry-point
  [{:keys [basis aot jar-name main working-dir]}]
  (->> (concat
        ["java ${JAVA_OPTS} -Dclojure.main.report=stderr -Dfile.encoding=UTF-8"]
        (-> basis :argmap :jvm-opts)
        (if aot
          ["-jar" jar-name]
          (concat
           ["-cp" (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 ["sh" "-c"])))

Maybe the user could provide his own custom-entry-point in the jib config?

And in jib-build we could replace:

(.setEntrypoint (entry-point c))

by

(.setEntrypoint ((or (load-entry-point custom-entry-point) entry-point) c)) ;; with custom-entry-point the eventual custom fn provided in jib.edn for instance

Let me know if it makes sense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.