mirror of https://github.com/kubernetes/kops.git
Docker build: Squashing kills the environment, fix the PATH up manually
This commit is contained in:
parent
256ff41864
commit
e4e9a7e3e6
|
@ -14,7 +14,7 @@ ARG KUBECTL_ARCH=linux/amd64
|
|||
RUN apk add --no-cache --update build-base curl git mercurial --virtual .kops-deps && \
|
||||
go get -d k8s.io/kops && \
|
||||
cd "${GOPATH}/src/k8s.io/kops" && git fetch origin && git reset --hard "${KOPS_GITISH}" && git clean -xdf && go get -d . && \
|
||||
make && \
|
||||
make && ln -s /go/bin/kops /bin && \
|
||||
MODELS=$(readlink "${GOPATH}/bin/models") && rm "${GOPATH}/bin/models" && mv "${MODELS}" "${GOPATH}/bin/models" && \
|
||||
GITISH=$(git describe --always) && \
|
||||
KUBECTL_VERSION=${KUBECTL_VERSION:-$(curl -SsL --retry 5 "https://storage.googleapis.com/${KUBECTL_SOURCE}/${KUBECTL_TRACK}")} && \
|
||||
|
@ -22,7 +22,7 @@ RUN apk add --no-cache --update build-base curl git mercurial --virtual .kops-d
|
|||
curl -SsL --retry 5 "https://storage.googleapis.com/${KUBECTL_SOURCE}/${KUBECTL_VERSION}/${KUBECTL_ARCH}/kubectl" > /usr/local/bin/kubectl && \
|
||||
chmod +x /usr/local/bin/kubectl && \
|
||||
/usr/local/bin/kubectl version --client && \
|
||||
cd / && rm -rf "${GOPATH}/src" && rm -rf "${GOPATH}/pkg" && rm -rf "/usr/local/go" && apk del .kops-deps && \
|
||||
cd / && rm -rf "${GOPATH}/src" && rm -rf "${GOPATH}/pkg" && rm -rf "/usr/local/go" && rm /usr/local/bin/go-wrapper && apk del .kops-deps && \
|
||||
echo "=== Built kops at ${GITISH}, fetched kubectl ${KUBECTL_VERSION} ==="
|
||||
|
||||
CMD "/go/bin/kops"
|
||||
|
|
Loading…
Reference in New Issue