mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
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.
This commit is contained in:
parent
15d1db9bf8
commit
184337568d
@ -1,6 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cat <<DF > Dockerfile
|
||||
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 /
|
||||
@ -8,4 +16,4 @@ EXPOSE 4001 7001 2379 2380
|
||||
ENTRYPOINT ["/etcd"]
|
||||
DF
|
||||
|
||||
docker build -t quay.io/coreos/etcd:${1} .
|
||||
docker build -t quay.io/coreos/etcd:${1} ${IMAGEDIR}
|
||||
|
Loading…
x
Reference in New Issue
Block a user