File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace App \Actions \Server ;
4
4
5
+ use App \Models \InstanceSettings ;
5
6
use App \Models \Server ;
6
7
use Lorisleiva \Actions \Concerns \AsAction ;
7
8
@@ -21,10 +22,16 @@ public function handle(Server $server)
21
22
22
23
private function getCommands (): array
23
24
{
25
+ $ settings = InstanceSettings::get ();
26
+ $ helperImageVersion = data_get ($ settings , 'helper_version ' );
27
+ $ helperImage = config ('coolify.helper_image ' );
28
+ $ helperImageWithVersion = config ('coolify.helper_image ' ).': ' .$ helperImageVersion ;
29
+
24
30
$ commonCommands = [
25
31
'docker container prune -f --filter "label=coolify.managed=true" ' ,
26
32
'docker image prune -af --filter "label!=coolify.managed=true" ' ,
27
33
'docker builder prune -af ' ,
34
+ "docker images --filter before= $ helperImageWithVersion --filter reference= $ helperImage | grep $ helperImage | awk '{print $3}' | xargs -r docker rmi " ,
28
35
];
29
36
30
37
return $ commonCommands ;
You can’t perform that action at this time.
0 commit comments