Skip to content

Commit 91b0787

Browse files
committed
Merge pull request kubernetes#12313 from mesosphere/mesos-docker-guide
Clarify build instructions in mesos/docker guide
2 parents 531d3de + 73ca343 commit 91b0787

File tree

1 file changed

+48
-22
lines changed

1 file changed

+48
-22
lines changed

docs/getting-started-guides/mesos-docker.md

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ Required:
8484
Optional:
8585
- [Virtual Box](https://www.virtualbox.org/wiki/Downloads) - x86 hardware virtualizer
8686
- Required by Boot2Docker and Docker Machine
87+
- [Golang](https://golang.org/doc/install) - Go programming language
88+
- Required to build Kubernetes locally
89+
- [Make](https://en.wikipedia.org/wiki/Make_(software)) - Utility for building executables from source
90+
- Required to build Kubernetes locally with make
8791

8892
#### Install on Mac (Homebrew)
8993

@@ -110,6 +114,9 @@ means to get the latest versions.
110114
It is recommended to use Ubuntu, simply because it best supports AUFS, used by docker to mount volumes. Alternate file
111115
systems may not fully support docker-in-docker.
112116

117+
In order to build Kubernetes, the current user must be in a docker group with sudo privileges.
118+
See the docker docs for [instructions](https://docs.docker.com/installation/ubuntulinux/#create-a-docker-group).
119+
113120

114121
#### Boot2Docker Config (Mac)
115122

@@ -154,40 +161,35 @@ host machine (mac).
154161
155162
1. Build binaries
156163
157-
```
158-
KUBERNETES_CONTRIB=mesos hack/build-go.sh
159-
```
160-
161-
Alternatively, you can use `make`, if make is installed.
164+
You'll need to build kubectl (CLI) for your local architecture and operating system and the rest of the server binaries for linux/amd64.
162165
163-
Unless you're on linux, you'll also need to build the binaries for linux/amd64 (for the docker containers):
166+
Building a new release covers both cases:
164167
165168
```
166-
KUBERNETES_CONTRIB=mesos build/run.sh hack/build-go.sh
169+
KUBERNETES_CONTRIB=mesos build/release.sh
167170
```
168171
169-
Breakdown:
170-
- `KUBERNETES_CONTRIB=mesos` - enables building of the contrib/mesos binaries
171-
- `build/run.sh` - executes a command in the build container
172-
- `build-go.sh` - builds the Go binaries for the current architecture (linux/amd64 when in a docker container)
172+
For developers, it may be faster to [build locally](#build-locally).
173173
174174
1. [Optional] Build docker images
175175
176-
The following docker images are built as part of `./cluster/kube-up.sh`, but it may make sense to build them manually
177-
the first time because it may take a while. In the future some of these may be hosted publicly, but you will always
178-
need to at least rebuild the Kubernetes-Mesos image when using locally built binaries.
176+
The following docker images are built as part of `./cluster/kube-up.sh`, but it may make sense to build them manually the first time because it may take a while.
179177
180-
Test image includes all the dependencies required for running e2e tests.
178+
1. Test image includes all the dependencies required for running e2e tests.
181179
182-
```
183-
./cluster/mesos/docker/test/build.sh
184-
```
180+
```
181+
./cluster/mesos/docker/test/build.sh
182+
```
185183
186-
Kubernetes-Mesos image includes the compiled linux binaries.
184+
In the future, this image may be available to download. It doesn't contain anything specific to the current release, except its build dependencies.
187185
188-
```
189-
./cluster/mesos/docker/km/build.sh
190-
```
186+
1. Kubernetes-Mesos image includes the compiled linux binaries.
187+
188+
```
189+
./cluster/mesos/docker/km/build.sh
190+
```
191+
192+
This image needs to be built every time you recompile the server binaries.
191193
192194
1. [Optional] Configure Mesos resources
193195
@@ -297,6 +299,30 @@ ex: `./cluster/kubectl.sh get pods`
297299
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
298300
```
299301
302+
### Build Locally
303+
304+
The steps above tell you how to build in a container, for minimal local dependencies. But if you have Go and Make installed you can build locally much faster:
305+
306+
```
307+
KUBERNETES_CONTRIB=mesos make
308+
```
309+
310+
However, if you're not on linux, you'll still need to compile the linux/amd64 server binaries:
311+
312+
```
313+
KUBERNETES_CONTRIB=mesos build/run.sh hack/build-go.sh
314+
```
315+
316+
The above two steps should be significantly faster than cross-compiling a whole new release for every supported platform (which is what `./build/release.sh` does).
317+
318+
Breakdown:
319+
320+
- `KUBERNETES_CONTRIB=mesos` - enables building of the contrib/mesos binaries
321+
- `hack/build-go.sh` - builds the Go binaries for the current architecture (linux/amd64 when in a docker container)
322+
- `make` - delegates to `hack/build-go.sh`
323+
- `build/run.sh` - executes a command in the build container
324+
- `build/release.sh` - cross compiles Kubernetes for all supported architectures and operating systems (slow)
325+
300326
301327
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
302328
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/mesos-docker.md?pixel)]()

0 commit comments

Comments
 (0)