docker-multi-arch-builder/main.go

49 lines
887 B
Go

package main
import log "github.com/sirupsen/logrus"
type Platform string
const (
LinuxArmV7 Platform = "linux/arm/v7"
LinuxArmV6 Platform = "linux/arm/v6"
LinuxArm64 Platform = "linux/arm64"
LinuxAmd64 Platform = "linux/amd64"
)
// init logging parameter
func init() {
log.SetLevel(log.InfoLevel)
//log.SetLevel(log.DebugLevel)
}
func main() {
myRegistry := Registry{
"docker.registry",
5000,
}
manifests := []ManifestImage{
NewManifest(
"registry-ui",
"latest",
"../rasp/registry/ui/",
[]Platform{LinuxArmV6},
"",
),
NewManifest(
"haproxy-k8s",
"latest",
"../dx30/haproxy-k8s",
[]Platform{LinuxArm64, LinuxAmd64},
"",
),
}
for _, manifest := range manifests {
log.Infof("-> Deal with manifest %s folder %s\n", manifest.name, manifest.buildDir)
manifest.CreateLayers(myRegistry)
manifest.CreateManifest(myRegistry)
}
}