build-docker 541 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. if [ "$#" -ne 1 ]; then
  3. echo "Usage: $0 VERSION" >&2
  4. exit 1
  5. fi
  6. VERSION=${1}
  7. BINARYDIR=${BINARYDIR:-.}
  8. BUILDDIR=${BUILDDIR:-.}
  9. IMAGEDIR=${BUILDDIR}/image-docker
  10. mkdir -p ${IMAGEDIR}
  11. cp ${BINARYDIR}/etcd ${BINARYDIR}/etcdctl ${IMAGEDIR}
  12. cat ./Dockerfile-release > ${IMAGEDIR}/Dockerfile
  13. if [ -z "$TAG" ]; then
  14. docker build -t "gcr.io/etcd-development/etcd:${VERSION}" "${IMAGEDIR}"
  15. docker build -t "quay.io/coreos/etcd:${VERSION}" "${IMAGEDIR}"
  16. else
  17. docker build -t "${TAG}:${VERSION}" "${IMAGEDIR}"
  18. fi