move build argument to manifest level
This commit is contained in:
parent
5a540072af
commit
de7ec5b8bb
8
image.go
8
image.go
@ -22,9 +22,10 @@ type ManifestImage struct {
|
|||||||
Image
|
Image
|
||||||
layers Layers
|
layers Layers
|
||||||
buildDir string
|
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{
|
return ManifestImage{
|
||||||
Image: Image{
|
Image: Image{
|
||||||
imageName,
|
imageName,
|
||||||
@ -32,13 +33,14 @@ func NewManifest(imageName string, imageTag string, buildDir string, platforms [
|
|||||||
},
|
},
|
||||||
layers: NewLayers(imageName, platforms),
|
layers: NewLayers(imageName, platforms),
|
||||||
buildDir: buildDir,
|
buildDir: buildDir,
|
||||||
|
buildOpt: buildOpt,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateLayers build and push each layer image
|
// 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 {
|
for _, layer := range manifest.layers {
|
||||||
layer.CreateLayer(registry, manifest.buildDir, buildOpt)
|
layer.CreateLayer(registry, manifest.buildDir, manifest.buildOpt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
main.go
9
main.go
@ -15,19 +15,18 @@ func main() {
|
|||||||
5000,
|
5000,
|
||||||
}
|
}
|
||||||
|
|
||||||
var manifests []ManifestImage
|
manifests := []ManifestImage{
|
||||||
|
|
||||||
manifests = append(manifests,
|
|
||||||
NewManifest(
|
NewManifest(
|
||||||
"registry-ui",
|
"registry-ui",
|
||||||
"latest",
|
"latest",
|
||||||
"../rasp/registry/ui/",
|
"../rasp/registry/ui/",
|
||||||
[]string{"linux/arm/v6"},
|
[]string{"linux/arm/v6"},
|
||||||
|
"",
|
||||||
),
|
),
|
||||||
)
|
}
|
||||||
|
|
||||||
for _, manifest := range manifests {
|
for _, manifest := range manifests {
|
||||||
manifest.CreateLayers(myRegistry, "")
|
manifest.CreateLayers(myRegistry)
|
||||||
manifest.CreateManifest(myRegistry)
|
manifest.CreateManifest(myRegistry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user