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

Dev environment setup for k8s on Windows machine #1703

Merged
merged 3 commits into from
Nov 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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