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
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
9
main.go
9
main.go
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user