Skip to content

Commit

Permalink
explicitly delete containers before re-creation ; more logs to check …
Browse files Browse the repository at this point in the history
…effective update
  • Loading branch information
patrick borowy committed Mar 22, 2024
1 parent 6ff2079 commit 7c19c2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,20 @@ async def recreate_container(
container, details, module_digest_map, last_pull_times
)
return
logging.info(f"Existing container image is {details['Image']}")
logging.info("Stopping & Deleting it")
await container.stop()
await container.delete()

# logging.info(f"{json.dumps(details, indent=4)}")
config['HostConfig'] = details['HostConfig']
new_container = await docker.containers.create_or_replace(
name=details['Name'][1:], config=config
)
new_details = await new_container.show()
logging.info(f"New container image is {new_details['Image']}")
await new_container.start()
logging.info("New container started")

# Custom deserializer for datetime objects
def datetime_deserializer(dict_):
Expand Down

0 comments on commit 7c19c2d

Please sign in to comment.