This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev environment setup for k8s on Windows machine (#1703)
* Dev environment setup for k8s on Windows machine * Add symlink check * Fix printed message
- Loading branch information
1 parent
f2f8159
commit b5c6a25
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |