@@ -66,15 +66,16 @@ public static void DockerCreateManifest(this BuildContextBase context, DockerIma
66
66
var manifestTags = context . GetDockerTags ( dockerImage ) ;
67
67
foreach ( var tag in manifestTags )
68
68
{
69
+ var manifestCreateSettings = new DockerManifestCreateSettings { Amend = true } ;
69
70
var amd64Tag = $ "{ tag } -{ Architecture . Amd64 . ToSuffix ( ) } ";
70
71
if ( skipArm64Image )
71
72
{
72
- context . DockerManifestCreate ( tag , amd64Tag ) ;
73
+ context . DockerManifestCreate ( manifestCreateSettings , tag , amd64Tag ) ;
73
74
}
74
75
else
75
76
{
76
77
var arm64Tag = $ "{ tag } -{ Architecture . Arm64 . ToSuffix ( ) } ";
77
- context . DockerManifestCreate ( tag , amd64Tag , arm64Tag ) ;
78
+ context . DockerManifestCreate ( manifestCreateSettings , tag , amd64Tag , arm64Tag ) ;
78
79
}
79
80
}
80
81
}
@@ -84,19 +85,9 @@ public static void DockerPushManifest(this BuildContextBase context, DockerImage
84
85
var manifestTags = context . GetDockerTags ( dockerImage ) ;
85
86
foreach ( var tag in manifestTags )
86
87
{
87
- context . DockerManifestPush ( tag ) ;
88
+ context . DockerManifestPush ( new DockerManifestPushSettings { Purge = true } , tag ) ;
88
89
}
89
90
}
90
- public static void DockerRemoveManifest ( this BuildContextBase context , DockerImage dockerImage )
91
- {
92
- var manifestTags = context . GetDockerTags ( dockerImage ) ;
93
- foreach ( var tag in manifestTags )
94
- {
95
- context . DockerManifestRemove ( tag ) ;
96
- }
97
- }
98
-
99
- private static void DockerManifestRemove ( this ICakeContext context , string tag ) => context . DockerCustomCommand ( $ "manifest rm { tag } ") ;
100
91
101
92
public static void DockerPullImage ( this ICakeContext context , DockerImage dockerImage )
102
93
{
@@ -190,10 +181,10 @@ private static IEnumerable<string> GetDockerTags(this BuildContextBase context,
190
181
}
191
182
}
192
183
193
- if ( ! arch . HasValue ) return tags ;
184
+ if ( ! arch . HasValue ) return tags . Distinct ( ) ;
194
185
195
186
var suffix = arch . Value . ToSuffix ( ) ;
196
- return tags . Select ( x => $ "{ x } -{ suffix } ") ;
187
+ return tags . Select ( x => $ "{ x } -{ suffix } ") . Distinct ( ) ;
197
188
198
189
}
199
190
private static string DockerImageName ( this DockerImage image ) => $ "{ image . Registry } /{ ( image . UseBaseImage ? Constants . DockerBaseImageName : Constants . DockerImageName ) } ";
0 commit comments