juxt / pack.alpha

Package clojure projects
MIT License
259 stars 35 forks source link

Clojurific api for docker volumes #106

Open SevereOverfl0w opened 2 years ago

SevereOverfl0w commented 2 years ago

A continuation of #99.

It's unclear to me what a comprehensive, simple set of APIs should be for including custom layers in a docker image.

SevereOverfl0w commented 2 years ago

For anyone looking for an easy way to include a directory layer, here is my REPL test:

(docker {:basis (juxt.pack.cli.api/create-basis nil)
           :layers [:libs
                    (-> (com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer/builder)
                        (.addEntryRecursive
                          (java.nio.file.Path/of "/tmp/config" (into-array String []))
                          (com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath/get "/config"))
                        (.build))
                    :paths]

           :image-type :tar
           :image-name "pack"
           :tar-file "pack.tar"})