move build argument to manifest level

This commit is contained in:
RouxAntoine 2022-01-07 21:55:38 +01:00
parent 5a540072af
commit de7ec5b8bb
Signed by: antoine
GPG Key ID: 098FB66FC0475E70
2 changed files with 9 additions and 8 deletions

View File

@ -22,9 +22,10 @@ type ManifestImage struct {
Image
layers Layers
buildDir string
buildOpt string
}
func NewManifest(imageName string, imageTag string, buildDir string, platforms []string) ManifestImage {
func NewManifest(imageName string, imageTag string, buildDir string, platforms []string, buildOpt string) ManifestImage {
return ManifestImage{
Image: Image{
imageName,
@ -32,13 +33,14 @@ func NewManifest(imageName string, imageTag string, buildDir string, platforms [
},
layers: NewLayers(imageName, platforms),
buildDir: buildDir,
buildOpt: buildOpt,
}
}
// CreateLayers build and push each layer image
func (manifest *ManifestImage) CreateLayers(registry Registry, buildOpt string) {
func (manifest *ManifestImage) CreateLayers(registry Registry) {
for _, layer := range manifest.layers {
layer.CreateLayer(registry, manifest.buildDir, buildOpt)
layer.CreateLayer(registry, manifest.buildDir, manifest.buildOpt)
}
}

View File

@ -15,19 +15,18 @@ func main() {
5000,
}
var manifests []ManifestImage
manifests = append(manifests,
manifests := []ManifestImage{
NewManifest(
"registry-ui",
"latest",
"../rasp/registry/ui/",
[]string{"linux/arm/v6"},
"",
),
)
}
for _, manifest := range manifests {
manifest.CreateLayers(myRegistry, "")
manifest.CreateLayers(myRegistry)
manifest.CreateManifest(myRegistry)
}
}