From e826439e79535bcfcdecef433b78d6889eca9e66 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Tue, 18 Aug 2020 14:34:10 -0700 Subject: [PATCH] Update build instructions (#2136) * Update build instructions Signed-off-by: Brad Davidson --- BUILDING.md | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 8b7cbba7b9..bafedb03fa 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,39 +1,28 @@ See the [release](https://github.com/rancher/k3s/releases/latest) page for pre-built releases. The clone will be much faster on this repo if you do - ```bash git clone --depth 1 https://github.com/rancher/k3s.git ``` This repo includes all of Kubernetes history so `--depth 1` will avoid most of that. -To build the full release binary run `make` and that will create `./dist/artifacts/k3s`. - -Optionally to build the binaries using local Go environment without running linting or building docker images: - +The k3s build process requires some autogenerated code and remote artifacts that are not checked in to version control. +To prepare these resources for your build environment, run:. ```bash -./scripts/download && ./scripts/build && ./scripts/package-cli +mkdir -p build/data && ./scripts/download && go generate ``` -For development, you just need go 1.12+ and a proper GOPATH. To compile the binaries run: +To build the full release binary, you may now run `make`, which will create `./dist/artifacts/k3s`. +To build the binaries using without running linting (ie; if you have uncommitted changes): ```bash -go build -o k3s -go build -o kubectl ./cmd/kubectl -go build -o hyperkube ./vendor/k8s.io/kubernetes/cmd/hyperkube +SKIP_VALIDATE=true make ``` -This will create the main executable at `./dist/artifacts` , but it does not include the dependencies like containerd, CNI, -etc. To run a server and agent with all the dependencies for development run the following -helper scripts: - +If you make any changes to go.mod and want to update the vendored modules, you should run the following before runnining `make`: ```bash -# Server -./scripts/dev-server.sh - -# Agent -./scripts/dev-agent.sh +go mod vendor && go mod tidy ``` Kubernetes Source