Skip to content
Snippets Groups Projects
Commit bfb1f049 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Try to download existing images to save build time

parent 65c38bdd
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,16 @@ def main():
for idx, fname in enumerate(dockerfiles):
progress = "({}/{})".format(idx + 1, n_files)
print('-' * 79)
print("{} Checking for existing '{}'".format(progress, fname))
pull_cmd = ("docker pull {0}/{1}".format(REGISTRY_URL, fname))
child = sp.Popen(
pull_cmd, shell=True, stdout=sys.stdout, stderr=sp.PIPE)
child.communicate()
if child.returncode > 0:
print(" -> no image found for '{}', starting from scratch.".
format(fname))
print('-' * 79)
print("{} Building '{}'".format(progress, fname))
build_cmd = ("docker build --pull -t {0}/{1} -f {1} . ".format(
......@@ -28,5 +38,6 @@ def main():
push_cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
child.communicate()
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment