Skip to content

Commit

Permalink
Merge pull request etcd-io#7294 from mkumatag/ppc64le_docker
Browse files Browse the repository at this point in the history
Build docker image for ppc64le
  • Loading branch information
Anthony Romano authored Feb 28, 2017
2 parents 8f744fe + 633cfbe commit 1a9cd7b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Dockerfile-release.ppc64le
Original file line number Diff line number Diff line change
@@ -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"]
31 changes: 29 additions & 2 deletions scripts/build-docker
Original file line number Diff line number Diff line change
@@ -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:-.}

Expand All @@ -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}
3 changes: 2 additions & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#
set -e

ARCH=$(go env GOARCH)
VERSION=$1
if [ -z "${VERSION}" ]; then
echo "Usage: ${0} VERSION" >> /dev/stderr
Expand All @@ -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

0 comments on commit 1a9cd7b

Please sign in to comment.