Skip to content

Instantly share code, notes, and snippets.

@hlship
Created October 28, 2016 22:50
Show Gist options
  • Save hlship/589a02369312f23a8791ce486fdf903b to your computer and use it in GitHub Desktop.
Save hlship/589a02369312f23a8791ce486fdf903b to your computer and use it in GitHub Desktop.
(deftask init
"First step when building a Docker image. Optionally specifies a directory
of resources that can be added to the image."
[d dir DIR file "Directory to add."
f from IMAGE str "Base image name."]
(assert from "--from is required")
(assert (or (nil? dir)
(is-readable-directory? dir))
"--dir must specify an existing directory")
(with-pre-wrap fs
(cond-> (-> fs
(rm (user-files fs))
(df/edit df/instruction :preamble :from from))
dir (add-resource dir)
true commit!)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment