From 17a220eaee1ab8f14320cbd5968848744e3a57a0 Mon Sep 17 00:00:00 2001 From: Nirman Narang Date: Mon, 20 Jan 2020 07:09:59 -0800 Subject: [PATCH] scripts: Added s390x support for docker image release --- Dockerfile-release.s390x | 11 +++++++++++ etcdmain/etcd.go | 2 +- scripts/build-release.sh | 2 +- scripts/release | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 Dockerfile-release.s390x diff --git a/Dockerfile-release.s390x b/Dockerfile-release.s390x new file mode 100644 index 00000000000..75f2002e51e --- /dev/null +++ b/Dockerfile-release.s390x @@ -0,0 +1,11 @@ +FROM k8s.gcr.io/debian-base-s390x:v1.0.0 + +ADD etcd /usr/local/bin/ +ADD etcdctl /usr/local/bin/ +ADD var/etcd /var/etcd +ADD var/lib/etcd /var/lib/etcd + +EXPOSE 2379 2380 + +# Define default command. +CMD ["/usr/local/bin/etcd"] diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go index 7d1c6337c0c..d9c2604691c 100644 --- a/etcdmain/etcd.go +++ b/etcdmain/etcd.go @@ -603,7 +603,7 @@ func identifyDataDirOrDie(lg *zap.Logger, dir string) dirType { func checkSupportArch() { // TODO qualify arm64 - if runtime.GOARCH == "amd64" || runtime.GOARCH == "ppc64le" { + if runtime.GOARCH == "amd64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "s390x" { return } // unsupported arch only configured via environment variable diff --git a/scripts/build-release.sh b/scripts/build-release.sh index 8c2eee05008..2475e99cd0a 100755 --- a/scripts/build-release.sh +++ b/scripts/build-release.sh @@ -22,7 +22,7 @@ pushd "${ETCD_ROOT}" >/dev/null echo Building etcd binary... ./scripts/build-binary "${VERSION}" - for TARGET_ARCH in "amd64" "arm64" "ppc64le"; do + for TARGET_ARCH in "amd64" "arm64" "ppc64le" "s390x"; do echo Building ${TARGET_ARCH} docker image... GOOS=linux GOARCH=${TARGET_ARCH} BINARYDIR=release/etcd-${VERSION}-linux-${TARGET_ARCH} BUILDDIR=release ./scripts/build-docker "${VERSION}" done diff --git a/scripts/release b/scripts/release index 1623e9ce7aa..2b71b9ffab4 100755 --- a/scripts/release +++ b/scripts/release @@ -200,7 +200,7 @@ main() { echo "Pushing container images to gcr.io ${RELEASE_VERSION}" gcloud docker -- push "gcr.io/etcd-development/etcd:${RELEASE_VERSION}" - for TARGET_ARCH in "-arm64" "-ppc64le"; do + for TARGET_ARCH in "-arm64" "-ppc64le" "-s390x"; do echo "Pushing container images to quay.io ${RELEASE_VERSION}${TARGET_ARCH}" docker push "quay.io/coreos/etcd:${RELEASE_VERSION}${TARGET_ARCH}"