etcd/scripts/build-docker
Yicheng Qin 184337568d scripts/build-docker: build docker in image-docker dir
The docker build command will use whatever directory contains the
Dockerfile as the build context (including all of its subdirectories).
And the <src> path of ADD must be inside the context of the build.
So change it to build in a specific directory for clean and fast.
2015-09-06 00:17:41 -07:00

20 lines
360 B
Bash
Executable File

#!/usr/bin/env bash
BINARYDIR=${BINARYDIR:-.}
BUILDDIR=${BUILDDIR:-.}
IMAGEDIR=${BUILDDIR}/image-docker
mkdir -p ${IMAGEDIR}
cp ${BINARYDIR}/etcd ${BINARYDIR}/etcdctl ${IMAGEDIR}
cat <<DF > ${IMAGEDIR}/Dockerfile
FROM scratch
ADD etcd /
ADD etcdctl /
EXPOSE 4001 7001 2379 2380
ENTRYPOINT ["/etcd"]
DF
docker build -t quay.io/coreos/etcd:${1} ${IMAGEDIR}