2019-11-11 19:17:22 +00:00
|
|
|
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
|
2020-03-04 09:47:40 +00:00
|
|
|
```bash
|
|
|
|
git clone --depth 1 https://github.com/rancher/k3s.git
|
|
|
|
```
|
2019-11-11 19:17:22 +00:00
|
|
|
|
|
|
|
This repo includes all of Kubernetes history so `--depth 1` will avoid most of that.
|
|
|
|
|
2020-08-18 21:34:10 +00:00
|
|
|
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:.
|
2020-03-04 09:47:40 +00:00
|
|
|
```bash
|
2020-08-18 21:34:10 +00:00
|
|
|
mkdir -p build/data && ./scripts/download && go generate
|
2019-11-11 19:17:22 +00:00
|
|
|
```
|
|
|
|
|
2020-08-18 21:34:10 +00:00
|
|
|
To build the full release binary, you may now run `make`, which will create `./dist/artifacts/k3s`.
|
2020-03-04 09:47:40 +00:00
|
|
|
|
2020-08-18 21:34:10 +00:00
|
|
|
To build the binaries using without running linting (ie; if you have uncommitted changes):
|
2019-11-11 19:17:22 +00:00
|
|
|
```bash
|
2020-08-18 21:34:10 +00:00
|
|
|
SKIP_VALIDATE=true make
|
2019-11-11 19:17:22 +00:00
|
|
|
```
|
|
|
|
|
2020-08-18 21:34:10 +00:00
|
|
|
If you make any changes to go.mod and want to update the vendored modules, you should run the following before runnining `make`:
|
2019-11-11 19:17:22 +00:00
|
|
|
```bash
|
2020-08-18 21:34:10 +00:00
|
|
|
go mod vendor && go mod tidy
|
2019-11-11 19:17:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Kubernetes Source
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
The source code for Kubernetes is in `vendor/` and the location from which that is copied
|
2019-11-14 10:54:50 +00:00
|
|
|
is in `./go.mod`. Go to the referenced repo/tag and you'll find all the patches applied
|
2019-11-11 19:17:22 +00:00
|
|
|
to upstream Kubernetes.
|
2020-03-04 09:47:40 +00:00
|
|
|
|