Initial commit
This commit is contained in:
20
dev/user.clj
Normal file
20
dev/user.clj
Normal file
@@ -0,0 +1,20 @@
|
||||
(ns user
|
||||
(:require [babashka.pods :as pods]))
|
||||
|
||||
(pods/load-pod 'atomisthq/docker "0.1.0")
|
||||
(require '[pod.babashka.docker :as docker])
|
||||
|
||||
;; parse image names using github.com/docker/distribution
|
||||
;; turns golang structs into clojure maps
|
||||
(docker/parse-image-name "gcr.io/whatever:tag")
|
||||
;; automatically turns golang errors into Exceptions
|
||||
(try
|
||||
(docker/parse-image-name "gcr.io/whatever/:tag")
|
||||
(catch Exception e
|
||||
;; invalid reference format
|
||||
(println (.getMessage e))))
|
||||
|
||||
;; parse dockerfiles using github.com/moby/buildkit
|
||||
;; returns the Result struct transformed to a clojure map
|
||||
(docker/parse-dockerfile "FROM \\\n gcr.io/whatever:tag\nCMD [\"run\"]")
|
||||
|
||||
Reference in New Issue
Block a user