Skip to content

Commit 809dc37

Browse files
committed
Add extra and old docker images cleanup on update
Signed-off-by: Riddhesh Sanghvi <[email protected]>
1 parent 730a310 commit 809dc37

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

php/EE/Migration/Containers.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,25 @@ public static function save_upgraded_image_versions( $current_versions, $new_ver
8181
'EE\Migration\Containers::revert_database_entry',
8282
[ $new_versions, $updated_images ],
8383
[ $current_versions, $updated_images ]
84+
);
8485

86+
self::$rsp->add_step(
87+
'prune-old-docker-images',
88+
'EE\Migration\Containers::image_cleanup',
89+
null,
90+
null,
91+
null
8592
);
8693

8794
}
8895

96+
/**
97+
* Prune old and extra EE Docker images.
98+
*/
99+
public static function image_cleanup() {
100+
EE::exec( 'docker image prune -af --filter=label=org.label-schema.vendor="EasyEngine"' );
101+
}
102+
89103
/**
90104
* Update database entry of images
91105
*

0 commit comments

Comments
 (0)