Handle the case where there is no FROM command in the Dockerfile

This commit is contained in:
Joseph Schorr 2014-06-13 16:56:48 -04:00
parent 6d07cf94d2
commit f795868b5b

View file

@ -206,6 +206,10 @@ class DockerfileBuildContext(object):
# Pull the image, in case it was updated since the last build
image_and_tag = ':'.join(self._parsed_dockerfile.get_image_and_tag())
if image_and_tag is None or image_and_tag[0] is None:
self._build_logger('Missing FROM command in Dockerfile', build_logs.ERROR)
raise JobException('Missing FROM command in Dockerfile')
self._build_logger('Pulling base image: %s' % image_and_tag)
pull_status = self._build_cl.pull(image_and_tag, stream=True)