Unverified Commit e826439e authored by Brad Davidson's avatar Brad Davidson Committed by GitHub

Update build instructions (#2136)

* Update build instructions Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
parent 4e990b40
See the [release](https://github.com/rancher/k3s/releases/latest) page for pre-built releases. 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 The clone will be much faster on this repo if you do
```bash ```bash
git clone --depth 1 https://github.com/rancher/k3s.git 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. 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`. 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:.
Optionally to build the binaries using local Go environment without running linting or building docker images:
```bash ```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 ```bash
go build -o k3s SKIP_VALIDATE=true make
go build -o kubectl ./cmd/kubectl
go build -o hyperkube ./vendor/k8s.io/kubernetes/cmd/hyperkube
``` ```
This will create the main executable at `./dist/artifacts` , but it does not include the dependencies like containerd, CNI, If you make any changes to go.mod and want to update the vendored modules, you should run the following before runnining `make`:
etc. To run a server and agent with all the dependencies for development run the following
helper scripts:
```bash ```bash
# Server go mod vendor && go mod tidy
./scripts/dev-server.sh
# Agent
./scripts/dev-agent.sh
``` ```
Kubernetes Source Kubernetes Source
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment