2018-05-29 19:33:05 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-01-31 22:04:07 +01:00
|
|
|
# Build images for Prometheus Operator and dependencies
|
|
|
|
# Run on Linux AMD64 machine due to qemu image for rbac-proxy
|
|
|
|
|
2019-01-31 21:31:53 +01:00
|
|
|
export DOCKER_CLI_EXPERIMENTAL=enabled
|
|
|
|
|
2018-06-11 17:31:49 +02:00
|
|
|
REPO=carlosedp
|
|
|
|
|
2019-01-31 21:31:53 +01:00
|
|
|
AOR_VERSION=2.1
|
2019-08-08 22:09:53 +02:00
|
|
|
PROM_ADAPTER_VERSION=v0.5.0
|
|
|
|
KSM_VERSION=v1.7.2
|
|
|
|
PROM_OP_VERSION=v0.31.1
|
2019-01-31 22:04:07 +01:00
|
|
|
KUBE_RBAC_VERSION=v0.4.1
|
2019-08-08 22:09:53 +02:00
|
|
|
PROM_CONFIG_RELOADER_VERSION=v0.31.1
|
2019-01-31 21:31:53 +01:00
|
|
|
CONFIGMAP_RELOAD_VERSION=v0.2.2
|
2018-12-12 18:18:00 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
2018-06-18 23:53:48 +02:00
|
|
|
# Kubernetes addon-resizer
|
|
|
|
# Retag Addon-resizer google images to have unified manifest on DockerHub
|
2019-01-31 21:31:53 +01:00
|
|
|
docker pull gcr.io/google-containers/addon-resizer-arm:$AOR_VERSION
|
|
|
|
docker pull gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION
|
|
|
|
docker pull gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION
|
2018-12-12 18:18:00 +01:00
|
|
|
|
2019-01-31 21:31:53 +01:00
|
|
|
docker tag gcr.io/google-containers/addon-resizer-arm:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-arm
|
|
|
|
docker tag gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-arm64
|
|
|
|
docker tag gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-amd64
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2019-01-31 21:31:53 +01:00
|
|
|
docker push $REPO/addon-resizer:$AOR_VERSION-arm
|
|
|
|
docker push $REPO/addon-resizer:$AOR_VERSION-arm64
|
|
|
|
docker push $REPO/addon-resizer:$AOR_VERSION-amd64
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2019-01-31 21:45:20 +01:00
|
|
|
docker rmi gcr.io/google-containers/addon-resizer-arm:$AOR_VERSION
|
|
|
|
docker rmi gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION
|
|
|
|
docker rmi gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION
|
|
|
|
docker rmi $REPO/addon-resizer:$AOR_VERSION-arm
|
|
|
|
docker rmi $REPO/addon-resizer:$AOR_VERSION-arm64
|
|
|
|
docker rmi $REPO/addon-resizer:$AOR_VERSION-amd64
|
|
|
|
|
2019-01-31 22:04:07 +01:00
|
|
|
IMAGE=$REPO/addon-resizer
|
|
|
|
VERSION=$AOR_VERSION
|
|
|
|
ALL_ARCH='amd64 arm arm64'
|
|
|
|
|
|
|
|
docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"`
|
|
|
|
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done
|
2019-02-04 20:22:30 +01:00
|
|
|
docker manifest push --purge $IMAGE:$VERSION
|
2019-01-31 21:31:53 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Prometheus-adapter
|
|
|
|
# Retag prometheus-adapter from directxman12 images to have unified manifest on DockerHub
|
|
|
|
|
|
|
|
docker pull directxman12/k8s-prometheus-adapter-arm:$PROM_ADAPTER_VERSION
|
|
|
|
docker pull directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION
|
|
|
|
docker pull directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION
|
|
|
|
|
|
|
|
docker tag directxman12/k8s-prometheus-adapter-arm:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm
|
|
|
|
docker tag directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm64
|
|
|
|
docker tag directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-amd64
|
|
|
|
|
|
|
|
docker push $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm
|
|
|
|
docker push $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm64
|
|
|
|
docker push $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-amd64
|
|
|
|
|
2019-01-31 21:45:20 +01:00
|
|
|
docker rmi directxman12/k8s-prometheus-adapter-arm:$PROM_ADAPTER_VERSION
|
|
|
|
docker rmi directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION
|
|
|
|
docker rmi directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION
|
|
|
|
docker rmi $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm
|
|
|
|
docker rmi $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm64
|
|
|
|
docker rmi $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-amd64
|
|
|
|
|
2019-01-31 21:31:53 +01:00
|
|
|
IMAGE=$REPO/k8s-prometheus-adapter
|
|
|
|
VERSION=$PROM_ADAPTER_VERSION
|
|
|
|
ALL_ARCH='amd64 arm arm64'
|
|
|
|
|
|
|
|
docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"`
|
|
|
|
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done
|
2019-02-04 20:22:30 +01:00
|
|
|
docker manifest push --purge $IMAGE:$VERSION
|
2018-12-12 18:18:00 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
2018-06-11 17:31:49 +02:00
|
|
|
# Kube-state-metrics
|
2018-12-12 18:18:00 +01:00
|
|
|
|
|
|
|
IMAGE=carlosedp/kube-state-metrics
|
|
|
|
ALL_ARCH='amd64 arm arm64'
|
2019-01-31 21:31:53 +01:00
|
|
|
VERSION=$KSM_VERSION
|
2018-12-12 18:18:00 +01:00
|
|
|
|
2019-08-09 00:38:35 +02:00
|
|
|
rm -rf $GOPATH/src/k8s.io/kube-state-metrics
|
|
|
|
mkdir $GOPATH/src/k8s.io/
|
|
|
|
pushd $GOPATH/src/k8s.io/
|
|
|
|
git clone https://github.com/kubernetes/kube-state-metrics
|
|
|
|
cd kube-state-metrics
|
2018-06-11 17:31:49 +02:00
|
|
|
git checkout ${KSM_VERSION}
|
2018-12-12 18:18:00 +01:00
|
|
|
|
2019-02-04 20:22:30 +01:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build .
|
2019-08-09 00:38:35 +02:00
|
|
|
docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-arm .
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2019-02-04 20:22:30 +01:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build .
|
2019-08-09 00:38:35 +02:00
|
|
|
docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-arm64 .
|
2018-12-12 18:18:00 +01:00
|
|
|
|
2019-02-04 20:22:30 +01:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' .
|
2019-08-09 00:38:35 +02:00
|
|
|
docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-amd64 .
|
2018-06-11 17:31:49 +02:00
|
|
|
|
|
|
|
docker push $REPO/kube-state-metrics:$KSM_VERSION-arm
|
|
|
|
docker push $REPO/kube-state-metrics:$KSM_VERSION-arm64
|
2018-12-12 18:18:00 +01:00
|
|
|
docker push $REPO/kube-state-metrics:$KSM_VERSION-amd64
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2019-01-31 21:31:53 +01:00
|
|
|
docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"`
|
|
|
|
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done
|
2019-02-04 20:22:30 +01:00
|
|
|
docker manifest push --purge $IMAGE:$VERSION
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2019-01-31 21:45:20 +01:00
|
|
|
popd
|
2018-12-12 18:18:00 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
2018-06-11 17:31:49 +02:00
|
|
|
# Prometheus-operator
|
2018-12-12 18:18:00 +01:00
|
|
|
IMAGE=carlosedp/prometheus-operator
|
|
|
|
ALL_ARCH='amd64 arm arm64'
|
2019-01-31 21:31:53 +01:00
|
|
|
VERSION=$PROM_OP_VERSION
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2019-08-09 00:38:35 +02:00
|
|
|
rm -rf $GOPATH/src/github.com/coreos/prometheus-operator
|
|
|
|
mkdir $GOPATH/src/github.com/coreos/
|
|
|
|
pushd $GOPATH/src/github.com/coreos/
|
|
|
|
git clone https://github.com/coreos/prometheus-operator
|
|
|
|
cd prometheus-operator
|
2018-06-11 17:31:49 +02:00
|
|
|
git checkout ${VERSION}
|
|
|
|
|
|
|
|
go get -u github.com/prometheus/promu
|
|
|
|
|
2018-12-12 18:18:00 +01:00
|
|
|
cat Dockerfile |sed -e 's/\.build\/linux-amd64\/operator/operator/' |sed -e 's/^FROM.*/FROM arm32v6\/busybox/' > Dockerfile.arm
|
|
|
|
|
|
|
|
cat Dockerfile |sed -e 's/\.build\/linux-amd64\/operator/operator/' |sed -e 's/^FROM.*/FROM arm64v8\/busybox/' > Dockerfile.arm64
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2019-01-31 21:45:20 +01:00
|
|
|
cat Dockerfile |sed -e 's/\.build\/linux-amd64\/operator/operator/' |sed -e 's/^FROM.*/FROM amd64\/busybox/' > Dockerfile.amd64
|
|
|
|
|
2018-06-11 17:31:49 +02:00
|
|
|
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`
|
2018-12-12 18:18:00 +01:00
|
|
|
docker build -t $REPO/prometheus-operator:${VERSION}-arm64 -f Dockerfile.arm64 .
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2019-01-31 21:45:20 +01:00
|
|
|
GOOS=linux GOARCH=amd64 $GOPATH/bin/promu build --prefix `pwd`
|
|
|
|
docker build -t $REPO/prometheus-operator:${VERSION}-amd64 -f Dockerfile.amd64 .
|
|
|
|
|
2018-06-11 17:31:49 +02:00
|
|
|
docker push $REPO/prometheus-operator:$VERSION-arm
|
|
|
|
docker push $REPO/prometheus-operator:$VERSION-arm64
|
2019-01-31 21:45:20 +01:00
|
|
|
docker push $REPO/prometheus-operator:$VERSION-amd64
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2018-12-12 18:18:00 +01:00
|
|
|
docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"`
|
|
|
|
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done
|
2019-02-04 20:22:30 +01:00
|
|
|
docker manifest push --purge $IMAGE:$VERSION
|
2018-06-11 17:31:49 +02:00
|
|
|
|
|
|
|
rm Dockerfile.arm
|
2018-12-12 18:18:00 +01:00
|
|
|
rm Dockerfile.arm64
|
2019-08-09 00:38:35 +02:00
|
|
|
rm Dockerfile.amd64
|
|
|
|
popd
|
2018-12-12 18:18:00 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# kube-rbac-proxy
|
|
|
|
IMAGE=carlosedp/kube-rbac-proxy
|
2019-01-31 21:31:53 +01:00
|
|
|
VERSION=$KUBE_RBAC_VERSION
|
2018-12-12 18:18:00 +01:00
|
|
|
ALL_ARCH='amd64 arm arm64'
|
|
|
|
|
|
|
|
go get github.com/brancz/kube-rbac-proxy
|
|
|
|
cd $HOME/go/src/github.com/brancz/kube-rbac-proxy
|
2019-01-31 22:47:22 +01:00
|
|
|
git fetch
|
2018-12-12 18:18:00 +01:00
|
|
|
git checkout ${VERSION}
|
|
|
|
|
|
|
|
cat > Dockerfile.arm <<EOF
|
|
|
|
FROM arm32v6/alpine:3.8
|
|
|
|
COPY qemu-arm-static /usr/bin/qemu-arm-static
|
|
|
|
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/*
|
|
|
|
COPY kube-rbac-proxy .
|
|
|
|
RUN rm /usr/bin/qemu-arm-static
|
|
|
|
ENTRYPOINT ["./kube-rbac-proxy"]
|
|
|
|
EXPOSE 8080
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > Dockerfile.arm64 <<EOF
|
|
|
|
FROM arm64v8/alpine:3.8
|
|
|
|
COPY qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
|
|
|
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/*
|
|
|
|
COPY kube-rbac-proxy .
|
|
|
|
ENTRYPOINT ["./kube-rbac-proxy"]
|
|
|
|
EXPOSE 8080
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > Dockerfile.amd64 <<EOF
|
2019-02-04 20:22:30 +01:00
|
|
|
FROM amd64/alpine:3.8
|
2018-12-12 18:18:00 +01:00
|
|
|
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/*
|
|
|
|
COPY kube-rbac-proxy .
|
|
|
|
ENTRYPOINT ["./kube-rbac-proxy"]
|
|
|
|
EXPOSE 8080
|
|
|
|
EOF
|
|
|
|
|
|
|
|
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
2019-01-31 22:47:22 +01:00
|
|
|
rm qemu-arm-static
|
2018-12-12 18:18:00 +01:00
|
|
|
wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-arm-static
|
|
|
|
chmod +x qemu-arm-static
|
2019-02-04 20:22:30 +01:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build .
|
2018-12-12 18:18:00 +01:00
|
|
|
docker build -t $IMAGE:$VERSION-arm -f Dockerfile.arm .
|
|
|
|
|
2019-01-31 22:47:22 +01:00
|
|
|
rm qemu-aarch64-static
|
2018-12-12 18:18:00 +01:00
|
|
|
wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-aarch64-static
|
|
|
|
chmod +x qemu-aarch64-static
|
2019-02-04 20:22:30 +01:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build .
|
2018-12-12 18:18:00 +01:00
|
|
|
docker build -t $IMAGE:$VERSION-arm64 -f Dockerfile.arm64 .
|
|
|
|
|
2019-02-04 20:22:30 +01:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' .
|
2018-12-12 18:18:00 +01:00
|
|
|
docker build -t $IMAGE:$VERSION-amd64 -f Dockerfile.amd64 .
|
|
|
|
|
|
|
|
docker push $IMAGE:$VERSION-arm
|
|
|
|
docker push $IMAGE:$VERSION-arm64
|
|
|
|
docker push $IMAGE:$VERSION-amd64
|
|
|
|
|
|
|
|
docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"`
|
|
|
|
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done
|
2019-02-04 20:22:30 +01:00
|
|
|
docker manifest push --purge $IMAGE:$VERSION
|
2018-06-11 17:31:49 +02:00
|
|
|
|
2018-12-12 18:18:00 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
2018-06-11 17:31:49 +02:00
|
|
|
# prometheus-config-reloader
|
2018-12-12 18:18:00 +01:00
|
|
|
IMAGE=carlosedp/prometheus-config-reloader
|
2019-01-31 21:31:53 +01:00
|
|
|
|
|
|
|
VERSION=$PROM_CONFIG_RELOADER_VERSION
|
2018-12-12 18:18:00 +01:00
|
|
|
ALL_ARCH='amd64 arm arm64'
|
|
|
|
|
2019-08-09 00:38:35 +02:00
|
|
|
|
|
|
|
pushd $GOPATH/src/github.com/coreos/prometheus-operator
|
|
|
|
cd $GOPATH/src/github.com/coreos/prometheus-operator/cmd/prometheus-config-reloader
|
2018-12-12 18:18:00 +01:00
|
|
|
git checkout ${VERSION}
|
|
|
|
|
2019-08-09 00:38:35 +02:00
|
|
|
cp ../../Dockerfile ./Dockerfile.new
|
|
|
|
cat Dockerfile.new |sed -e 's/ADD operator.*/ADD prometheus-config-reloader /bin/prometheus-config-reloader/' |sed -e 's/^ENTRYPOINT.*/ENTRYPOINT ["/bin/prometheus-config-reloader"]/' > Dockerfile.arm
|
|
|
|
|
|
|
|
|
2019-01-31 22:47:22 +01:00
|
|
|
wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-arm-static
|
|
|
|
wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-aarch64-static
|
|
|
|
chmod +x qemu*
|
|
|
|
|
2019-08-09 00:38:35 +02:00
|
|
|
cat Dockerfile.new |sed -e 's/^FROM.*/FROM arm32v6\/busybox/'|sed -e 's/ADD operator.*/ADD prometheus-config-reloader \/bin\/prometheus-config-reloader/' |sed -e 's/^ENTRYPOINT.*/ENTRYPOINT \["\/bin\/prometheus-config-reloader"\]/' > Dockerfile.arm
|
2018-05-29 19:33:05 +02:00
|
|
|
|
2019-08-09 00:38:35 +02:00
|
|
|
cat Dockerfile.new |sed -e 's/^FROM.*/FROM arm64v8\/busybox/'|sed -e 's/ADD operator.*/ADD prometheus-config-reloader \/bin\/prometheus-config-reloader/' |sed -e 's/^ENTRYPOINT.*/ENTRYPOINT \["\/bin\/prometheus-config-reloader"\]/' > Dockerfile.arm64
|
2018-05-29 19:33:05 +02:00
|
|
|
|
2019-08-09 00:38:35 +02:00
|
|
|
cat Dockerfile.new |sed -e 's/^FROM.*/FROM amd64\/busybox/'|sed -e 's/ADD operator.*/ADD prometheus-config-reloader \/bin\/prometheus-config-reloader/' |sed -e 's/^ENTRYPOINT.*/ENTRYPOINT \["\/bin\/prometheus-config-reloader"\]/' > Dockerfile.amd64
|
2019-01-31 21:45:20 +01: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-12-12 18:18:00 +01:00
|
|
|
docker build -t $IMAGE:$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-12-12 18:18:00 +01:00
|
|
|
docker build -t $IMAGE:$VERSION-arm64 -f Dockerfile.arm64 .
|
2018-05-29 19:33:05 +02:00
|
|
|
|
2019-02-04 20:22:30 +01:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o prometheus-config-reloader main.go
|
2019-01-31 21:45:20 +01:00
|
|
|
docker build -t $IMAGE:$VERSION-amd64 -f Dockerfile.amd64 .
|
2018-05-29 19:33:05 +02:00
|
|
|
|
2018-12-12 18:18:00 +01:00
|
|
|
docker push $IMAGE:$VERSION-arm
|
|
|
|
docker push $IMAGE:$VERSION-arm64
|
|
|
|
docker push $IMAGE:$VERSION-amd64
|
|
|
|
|
|
|
|
docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"`
|
|
|
|
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done
|
2019-02-04 20:22:30 +01:00
|
|
|
docker manifest push --purge $IMAGE:$VERSION
|
2018-05-29 19:33:05 +02:00
|
|
|
|
2018-06-11 17:31:49 +02:00
|
|
|
rm Dockerfile.arm
|
2018-12-12 18:18:00 +01:00
|
|
|
rm Dockerfile.arm64
|
2019-01-31 22:47:22 +01:00
|
|
|
rm Dockerfile.amd64
|
2019-08-09 00:38:35 +02:00
|
|
|
rm Dockerfile.new
|
2018-12-12 18:18:00 +01:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# configmap-reload
|
|
|
|
IMAGE=carlosedp/configmap-reload
|
2019-01-31 21:31:53 +01:00
|
|
|
VERSION=$CONFIGMAP_RELOAD_VERSION
|
2018-12-12 18:18:00 +01:00
|
|
|
ALL_ARCH='amd64 arm arm64'
|
|
|
|
|
|
|
|
go get github.com/openshift/configmap-reload
|
|
|
|
cd $HOME/go/src/github.com/openshift/configmap-reload
|
2019-01-31 22:47:22 +01:00
|
|
|
git fetch
|
2019-01-31 22:04:07 +01:00
|
|
|
git checkout ${VERSION}
|
2018-12-12 18:18:00 +01:00
|
|
|
|
|
|
|
cat > Dockerfile.arm <<EOF
|
|
|
|
FROM arm32v6/busybox
|
|
|
|
COPY configmap-reload /configmap-reload
|
|
|
|
ENTRYPOINT ["/configmap-reload"]
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > Dockerfile.arm64 <<EOF
|
|
|
|
FROM arm64v8/busybox
|
|
|
|
COPY configmap-reload /configmap-reload
|
|
|
|
ENTRYPOINT ["/configmap-reload"]
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > Dockerfile.amd64 <<EOF
|
|
|
|
FROM busybox
|
|
|
|
COPY configmap-reload /configmap-reload
|
|
|
|
ENTRYPOINT ["/configmap-reload"]
|
|
|
|
EOF
|
|
|
|
|
|
|
|
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build .
|
|
|
|
docker build -t $IMAGE:$VERSION-arm -f Dockerfile.arm .
|
|
|
|
|
|
|
|
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build .
|
|
|
|
docker build -t $IMAGE:$VERSION-arm64 -f Dockerfile.arm64 .
|
|
|
|
|
2019-02-04 20:22:30 +01:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' .
|
2018-12-12 18:18:00 +01:00
|
|
|
docker build -t $IMAGE:$VERSION-amd64 -f Dockerfile.amd64 .
|
|
|
|
|
|
|
|
docker push $IMAGE:$VERSION-arm
|
|
|
|
docker push $IMAGE:$VERSION-arm64
|
|
|
|
docker push $IMAGE:$VERSION-amd64
|
|
|
|
|
|
|
|
docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"`
|
|
|
|
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done
|
2019-02-04 20:22:30 +01:00
|
|
|
docker manifest push --purge $IMAGE:$VERSION
|