Skip to content

Commit

Permalink
docker-c: fix local image
Browse files Browse the repository at this point in the history
  • Loading branch information
magicnat committed Jan 21, 2022
1 parent be40141 commit fcfd83a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions seedemu/compiler/Docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,6 @@ def _makeDummies(self) -> str:
def _doCompile(self, emulator: Emulator):
registry = emulator.getRegistry()

for (image, ) in self.__images.values():
if image.getName() not in self._used_images or not image.isLocal(): continue
self.__services += DockerCompilerFileTemplates['local_image'].format(
imageName = image.getName(),
dirName = image.getDirName()
)

self._groupSoftware(emulator)

for ((scope, type, name), obj) in registry.getAll().items():
Expand Down Expand Up @@ -979,9 +972,18 @@ def _doCompile(self, emulator: Emulator):
ethClientPort = self.__eth_client_port,
)

local_images = ''

for (image, _) in self.__images.values():
if image.getName() not in self._used_images or not image.isLocal(): continue
local_images += DockerCompilerFileTemplates['local_image'].format(
imageName = image.getName(),
dirName = image.getDirName()
)

self._log('creating docker-compose.yml...'.format(scope, name))
print(DockerCompilerFileTemplates['compose'].format(
services = self.__services,
networks = self.__networks,
dummies = self._makeDummies()
dummies = local_images + self._makeDummies()
), file=open('docker-compose.yml', 'w'))

0 comments on commit fcfd83a

Please sign in to comment.