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

Commit b5c6a25

Browse files
JiangtianLijackfrancis
authored andcommitted
Dev environment setup for k8s on Windows machine (#1703)
* Dev environment setup for k8s on Windows machine * Add symlink check * Fix printed message
1 parent f2f8159 commit b5c6a25

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

Dockerfile.k8swin

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM buildpack-deps:xenial
2+
3+
RUN apt-get update \
4+
&& apt-get -y upgrade \
5+
&& apt-get -y install apt-transport-https ca-certificates make gcc gcc-aarch64-linux-gnu rsync python-pip build-essential curl openssl vim jq \
6+
&& rm -rf /var/lib/apt/lists/*
7+
8+
ENV GO_VERSION 1.8.3
9+
10+
RUN wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz \
11+
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz
12+
13+
RUN curl -fsSL https://get.docker.com/ | sh
14+
15+
ENV GOPATH /gopath
16+
ENV PATH "${PATH}:${GOPATH}/bin:/usr/local/go/bin"
17+
18+
RUN go get -u github.com/jteeuwen/go-bindata/go-bindata
19+
20+
WORKDIR /gopath/src/k8s.io/kubernetes
21+
22+
ADD . /gopath/src/k8s.io/kubernetes

scripts/devenv-k8swin.ps1

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Make sure to git clone Kubernetes repo with symlink
2+
# git clone -c core.symlinks=true https://github.com/Azure/kubernetes ${GOPATH}/src/k8s.io/kubernetes
3+
$k8spath = Join-Path -Path $Env:GOPATH -ChildPath "src\k8s.io\kubernetes"
4+
if (!(Test-Path -Path $k8spath))
5+
{
6+
Write-Host "Kubernetes path $k8spath does not exist!"
7+
exit
8+
}
9+
10+
$makefile = Join-Path -Path $k8spath -ChildPath "Makefile"
11+
if (!((Get-Item $makefile).Attributes.ToString() -match "ReparsePoint"))
12+
{
13+
Write-Host "Kubernetes Makefile $makefile is not a symlink!"
14+
Write-Host "Please use '-c core.symlinks=true' option in git clone."
15+
Write-Host "E.g., git clone -c core.symlinks=true https://github.com/Azure/kubernetes `${GOPATH}/src/k8s.io/kubernetes"
16+
exit
17+
}
18+
19+
Get-Content Dockerfile.k8swin | docker build --pull -t k8swin -
20+
docker run --security-opt seccomp:unconfined -it `
21+
-v ${k8spath}:/gopath/src/k8s.io/kubernetes `
22+
-w /gopath/src/k8s.io/kubernetes `
23+
k8swin /bin/bash

0 commit comments

Comments
 (0)