Docker build: Squashing kills the environment, fix the PATH up manually

This commit is contained in:
Zach Loafman 2016-08-17 06:03:46 -07:00
parent 256ff41864
commit e4e9a7e3e6
1 changed files with 2 additions and 2 deletions

View File

@ -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"