rpi.carlosedp.cluster-monit.../build_images.sh

87 lines
4.1 KiB
Bash
Raw Normal View History

2018-05-29 19:33:05 +02:00
#!/bin/bash
2018-06-11 17:31:49 +02:00
REPO=carlosedp
2018-05-29 19:33:05 +02:00
AOM_VERSION=2.1
2018-06-18 23:53:48 +02:00
KSM_VERSION=v1.3.0
VERSION=v0.20.0
PROMCONFIGRELOADER_VERSION=v0.20.0
2018-05-29 19:33:05 +02:00
2018-06-18 23:53:48 +02:00
# Kubernetes addon-resizer
# Retag Addon-resizer google images to have unified manifest on DockerHub
2018-05-29 19:33:05 +02:00
docker pull gcr.io/google-containers/addon-resizer-arm64:$AOM_VERSION
docker pull gcr.io/google-containers/addon-resizer-arm:$AOM_VERSION
2018-06-11 17:31:49 +02:00
docker tag gcr.io/google-containers/addon-resizer-arm64:$AOM_VERSION $REPO/addon-resizer:$AOM_VERSION-arm64
docker tag gcr.io/google-containers/addon-resizer-arm:$AOM_VERSION $REPO/addon-resizer:$AOM_VERSION-arm
docker push $REPO/addon-resizer:$AOM_VERSION-arm
docker push $REPO/addon-resizer:$AOM_VERSION-arm64
manifest-tool-linux-arm64 push from-args --platforms linux/arm,linux/arm64 --template $REPO/addon-resizer:$AOM_VERSION-ARCH --target $REPO/addon-resizer:$AOM_VERSION
manifest-tool-linux-arm64 push from-args --platforms linux/arm,linux/arm64 --template $REPO/addon-resizer:$AOM_VERSION-ARCH --target $REPO/addon-resizer:latest
# Kube-state-metrics
go get github.com/kubernetes/kube-state-metrics
mv $HOME/go/src/github.com/kubernetes/kube-state-metrics $HOME/go/src/k8s.io/kube-state-metrics
cd $HOME/go/src/k8s.io/kube-state-metrics
git checkout ${KSM_VERSION}
GOOS=linux GOARCH=arm go build .
docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-arm .
GOOS=linux GOARCH=arm64 go build .
docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-arm64 .
docker push $REPO/kube-state-metrics:$KSM_VERSION-arm
docker push $REPO/kube-state-metrics:$KSM_VERSION-arm64
manifest-tool-linux-arm64 push from-args --platforms linux/arm,linux/arm64 --template $REPO/kube-state-metrics:$KSM_VERSION-ARCH --target $REPO/kube-state-metrics:$KSM_VERSION
manifest-tool-linux-arm64 push from-args --platforms linux/arm,linux/arm64 --template $REPO/kube-state-metrics:$KSM_VERSION-ARCH --target $REPO/kube-state-metrics:latest
# Prometheus-operator
go get github.com/coreos/prometheus-operator
cd $HOME/go/src/github.com/coreos/prometheus-operator
git checkout ${VERSION}
go get -u github.com/prometheus/promu
cat Dockerfile |sed -e 's/\.build\/linux-amd64\/operator/operator/' |sed -e 's/^FROM.*/FROM busybox/' > Dockerfile.arm
GOOS=linux GOARCH=arm $GOPATH/bin/promu build --prefix `pwd`
docker build -t $REPO/prometheus-operator:${VERSION}-arm -f Dockerfile.arm .
GOOS=linux GOARCH=arm64 $GOPATH/bin/promu build --prefix `pwd`
docker build -t $REPO/prometheus-operator:${VERSION}-arm64 -f Dockerfile.arm .
docker push $REPO/prometheus-operator:$VERSION-arm
docker push $REPO/prometheus-operator:$VERSION-arm64
manifest-tool-linux-arm64 push from-args --platforms linux/arm,linux/arm64 --template $REPO/prometheus-operator:$VERSION-ARCH --target $REPO/prometheus-operator:$VERSION
manifest-tool-linux-arm64 push from-args --platforms linux/arm,linux/arm64 --template $REPO/prometheus-operator:$VERSION-ARCH --target $REPO/prometheus-operator:latest
rm Dockerfile.arm
# prometheus-config-reloader
go get github.com/coreos/prometheus-operator
cd $HOME/go/src/github.com/coreos/prometheus-operator/
2018-06-18 23:53:48 +02:00
git checkout ${PROMCONFIGRELOADER_VERSION}
2018-06-11 17:31:49 +02:00
cd $HOME/go/src/github.com/coreos/prometheus-operator/contrib/prometheus-config-reloader
2018-05-29 19:33:05 +02:00
2018-06-11 17:31:49 +02:00
cat Dockerfile |sed -e 's/^FROM.*/FROM busybox/' > Dockerfile.arm
2018-05-29 19:33:05 +02:00
2018-06-11 17:31:49 +02:00
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -o prometheus-config-reloader main.go
2018-06-18 23:53:48 +02:00
docker build -t $REPO/prometheus-config-reloader:${PROMCONFIGRELOADER_VERSION}-arm -f Dockerfile.arm .
2018-05-29 19:33:05 +02:00
2018-06-11 17:31:49 +02:00
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o prometheus-config-reloader main.go
2018-06-18 23:53:48 +02:00
docker build -t $REPO/prometheus-config-reloader:${PROMCONFIGRELOADER_VERSION}-arm64 -f Dockerfile.arm .
2018-05-29 19:33:05 +02:00
2018-06-18 23:53:48 +02:00
docker push $REPO/prometheus-config-reloader:$PROMCONFIGRELOADER_VERSION-arm
docker push $REPO/prometheus-config-reloader:$PROMCONFIGRELOADER_VERSION-arm64
2018-05-29 19:33:05 +02:00
2018-06-18 23:53:48 +02:00
manifest-tool-linux-arm64 push from-args --platforms linux/arm,linux/arm64 --template $REPO/prometheus-config-reloader:$PROMCONFIGRELOADER_VERSION-ARCH --target $REPO/prometheus-config-reloader:$VERSION
manifest-tool-linux-arm64 push from-args --platforms linux/arm,linux/arm64 --template $REPO/prometheus-config-reloader:$PROMCONFIGRELOADER_VERSION-ARCH --target $REPO/prometheus-config-reloader:latest
2018-05-29 19:33:05 +02:00
2018-06-11 17:31:49 +02:00
rm Dockerfile.arm