Bugfix: legacy code would prevent containers from shuting down after build
This commit is contained in:
parent
5caf9d92e3
commit
c570f0fd6d
@ -141,13 +141,9 @@ class Buildah(Target):
|
|||||||
async def clean(self, target):
|
async def clean(self, target):
|
||||||
for src, dst in self.mounts.items():
|
for src, dst in self.mounts.items():
|
||||||
await self.parent.exec('umount', self.root / str(dst)[1:])
|
await self.parent.exec('umount', self.root / str(dst)[1:])
|
||||||
else:
|
|
||||||
return
|
|
||||||
|
|
||||||
if self.result.status == 'success':
|
if self.result.status == 'success':
|
||||||
await self.commit()
|
await self.commit()
|
||||||
if os.getenv('BUILDAH_PUSH'):
|
|
||||||
await self.image.push(target)
|
|
||||||
|
|
||||||
if self.root is not None:
|
if self.root is not None:
|
||||||
await self.parent.exec('buildah', 'umount', self.ctr)
|
await self.parent.exec('buildah', 'umount', self.ctr)
|
||||||
@ -155,6 +151,10 @@ class Buildah(Target):
|
|||||||
if self.ctr is not None:
|
if self.ctr is not None:
|
||||||
await self.parent.exec('buildah', 'rm', self.ctr)
|
await self.parent.exec('buildah', 'rm', self.ctr)
|
||||||
|
|
||||||
|
if self.result.status == 'success':
|
||||||
|
if os.getenv('BUILDAH_PUSH'):
|
||||||
|
await self.image.push(target)
|
||||||
|
|
||||||
async def mount(self, src, dst):
|
async def mount(self, src, dst):
|
||||||
"""Mount a host directory into the container."""
|
"""Mount a host directory into the container."""
|
||||||
target = self.root / str(dst)[1:]
|
target = self.root / str(dst)[1:]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user