Skip [plugins,additions]-archive for binary builts

Skip the creation of `plugins-archive` or `additions-archive` for
binary builds as they are only checked-out as part of the source build
process. Doing so also has the nice side-effect of failing the build in
case someone accidently includes an 'ADD plugins-archive /' instruction
to the binary section of a Dockerfile.

Change-Id: I7442fcd9677466dd0878e124402b4d4170a1ab68
Related-Bug: #1681345
This commit is contained in:
Martin André 2017-04-10 10:52:44 +02:00
parent 15543949b1
commit 41dc35dc31

View File

@ -419,26 +419,27 @@ class BuildTask(DockerTask):
if image.status in STATUS_ERRORS:
return
try:
plugins_am = make_an_archive(image.plugins, 'plugins')
except ArchivingError:
self.logger.error(
"Failed turning any plugins into a plugins archive")
return
else:
self.logger.debug(
"Turned %s plugins into plugins archive",
plugins_am)
try:
additions_am = make_an_archive(image.additions, 'additions')
except ArchivingError:
self.logger.error(
"Failed turning any additions into a additions archive")
return
else:
self.logger.debug(
"Turned %s additions into additions archive",
additions_am)
if self.conf.install_type == 'source':
try:
plugins_am = make_an_archive(image.plugins, 'plugins')
except ArchivingError:
self.logger.error(
"Failed turning any plugins into a plugins archive")
return
else:
self.logger.debug(
"Turned %s plugins into plugins archive",
plugins_am)
try:
additions_am = make_an_archive(image.additions, 'additions')
except ArchivingError:
self.logger.error(
"Failed turning any additions into a additions archive")
return
else:
self.logger.debug(
"Turned %s additions into additions archive",
additions_am)
# Pull the latest image for the base distro only
pull = self.conf.pull if image.parent is None else False