diff --git a/Dockerfile-release.ppc64le b/Dockerfile-release.ppc64le new file mode 100644 index 00000000000..06365c8bc99 --- /dev/null +++ b/Dockerfile-release.ppc64le @@ -0,0 +1,11 @@ +FROM ppc64le/ubuntu:16.04 + +ADD etcd /usr/local/bin/ +ADD etcdctl /usr/local/bin/ +RUN mkdir -p /var/etcd/ +RUN mkdir -p /var/lib/etcd/ + +EXPOSE 2379 2380 + +# Define default command. +CMD ["/usr/local/bin/etcd"] diff --git a/scripts/build-docker b/scripts/build-docker index f728f6ea46d..44641322f79 100755 --- a/scripts/build-docker +++ b/scripts/build-docker @@ -1,5 +1,32 @@ #!/usr/bin/env bash +if [ "$#" -ne 1 ]; then + echo "Usage: $0 VERSION" >&2 + exit 1 +fi + +ARCH=$(go env GOARCH) +DOCKERFILE="Dockerfile-release" +TAG="quay.io/coreos/etcd" + +if [ -z ${BINARYDIR} ]; then + RELEASE="etcd-${1}"-`go env GOOS`-`go env GOARCH` + BINARYDIR="${RELEASE}" + TARFILE="${RELEASE}.tar.gz" + TARURL="https://github.com/coreos/etcd/releases/download/${1}/${TARFILE}" + curl -f -L -o ${TARFILE} ${TARURL} + if [ $? != 0 ]; then + echo "Failed to download ${TARURL}." + exit 1 + fi + tar -zvxf ${TARFILE} +fi + +if [ ${ARCH} != "amd64" ]; then + DOCKERFILE+=".${ARCH}" + TAG+="-${ARCH}" +fi + BINARYDIR=${BINARYDIR:-.} BUILDDIR=${BUILDDIR:-.} @@ -8,6 +35,6 @@ IMAGEDIR=${BUILDDIR}/image-docker mkdir -p ${IMAGEDIR} cp ${BINARYDIR}/etcd ${BINARYDIR}/etcdctl ${IMAGEDIR} -cat ./Dockerfile-release > ${IMAGEDIR}/Dockerfile +cat ./${DOCKERFILE} > ${IMAGEDIR}/Dockerfile -docker build -t quay.io/coreos/etcd:${1} ${IMAGEDIR} +docker build -t ${TAG}:${1} ${IMAGEDIR} diff --git a/scripts/release.sh b/scripts/release.sh index 27e8a4c36f8..67b6661ea26 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -5,6 +5,7 @@ # set -e +ARCH=$(go env GOARCH) VERSION=$1 if [ -z "${VERSION}" ]; then echo "Usage: ${0} VERSION" >> /dev/stderr @@ -29,5 +30,5 @@ pushd ${ETCD_ROOT} >/dev/null echo Building aci image... BINARYDIR=release/etcd-${VERSION}-linux-amd64 BUILDDIR=release ./scripts/build-aci ${VERSION} echo Building docker image... - BINARYDIR=release/etcd-${VERSION}-linux-amd64 BUILDDIR=release ./scripts/build-docker ${VERSION} + BINARYDIR=release/etcd-${VERSION}-linux-${ARCH} BUILDDIR=release ./scripts/build-docker ${VERSION} popd >/dev/null