Created
October 28, 2016 22:50
-
-
Save hlship/589a02369312f23a8791ce486fdf903b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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