diff --git a/Dockerfile.k8swin b/Dockerfile.k8swin new file mode 100644 index 0000000000..f7de6e4055 --- /dev/null +++ b/Dockerfile.k8swin @@ -0,0 +1,22 @@ +FROM buildpack-deps:xenial + +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get -y install apt-transport-https ca-certificates make gcc gcc-aarch64-linux-gnu rsync python-pip build-essential curl openssl vim jq \ + && rm -rf /var/lib/apt/lists/* + +ENV GO_VERSION 1.8.3 + +RUN wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz + +RUN curl -fsSL https://get.docker.com/ | sh + +ENV GOPATH /gopath +ENV PATH "${PATH}:${GOPATH}/bin:/usr/local/go/bin" + +RUN go get -u github.com/jteeuwen/go-bindata/go-bindata + +WORKDIR /gopath/src/k8s.io/kubernetes + +ADD . /gopath/src/k8s.io/kubernetes diff --git a/scripts/devenv-k8swin.ps1 b/scripts/devenv-k8swin.ps1 new file mode 100644 index 0000000000..0aab3c6486 --- /dev/null +++ b/scripts/devenv-k8swin.ps1 @@ -0,0 +1,23 @@ +# Make sure to git clone Kubernetes repo with symlink +# git clone -c core.symlinks=true https://github.com/Azure/kubernetes ${GOPATH}/src/k8s.io/kubernetes +$k8spath = Join-Path -Path $Env:GOPATH -ChildPath "src\k8s.io\kubernetes" +if (!(Test-Path -Path $k8spath)) +{ + Write-Host "Kubernetes path $k8spath does not exist!" + exit +} + +$makefile = Join-Path -Path $k8spath -ChildPath "Makefile" +if (!((Get-Item $makefile).Attributes.ToString() -match "ReparsePoint")) +{ + Write-Host "Kubernetes Makefile $makefile is not a symlink!" + Write-Host "Please use '-c core.symlinks=true' option in git clone." + Write-Host "E.g., git clone -c core.symlinks=true https://github.com/Azure/kubernetes `${GOPATH}/src/k8s.io/kubernetes" + exit +} + +Get-Content Dockerfile.k8swin | docker build --pull -t k8swin - +docker run --security-opt seccomp:unconfined -it ` + -v ${k8spath}:/gopath/src/k8s.io/kubernetes ` + -w /gopath/src/k8s.io/kubernetes ` + k8swin /bin/bash