From 7c19c2d35272ab644a04c9b4f26977ef5dd714ba Mon Sep 17 00:00:00 2001 From: patrick borowy Date: Fri, 22 Mar 2024 11:57:53 +0100 Subject: [PATCH] explicitly delete containers before re-creation ; more logs to check effective update --- src/update.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/update.py b/src/update.py index d16451d..6171b41 100644 --- a/src/update.py +++ b/src/update.py @@ -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_):