Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Dev environment setup for k8s on Windows machine (#1703)
Browse files Browse the repository at this point in the history
* Dev environment setup for k8s on Windows machine

* Add symlink check

* Fix printed message
  • Loading branch information
JiangtianLi authored and jackfrancis committed Nov 3, 2017
1 parent f2f8159 commit b5c6a25
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dockerfile.k8swin
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions scripts/devenv-k8swin.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b5c6a25

Please sign in to comment.