Merge pull request #139 from abailly/patch-1

document use of containerized buildctl
docker-18.09
Tõnis Tiigi 2017-10-12 18:02:46 -07:00 committed by GitHub
commit 35e433c290
1 changed files with 46 additions and 0 deletions

View File

@ -106,6 +106,52 @@ buildctl build ... --exporter=local --exporter-opt output=path/to/output-dir
buildctl du -v
```
#### Running containerized buildkit
buildkit daemon supports communicating with clients over TCP. This is supports some use cases like:
* Docker for Mac or Windows users which cannot yet run natively buildkit daemon on their platform,
* Centralized daemon for remote build scripts execution in a team settings
* ...
To run daemon in a container:
```
$ docker run --rm --privileged -p 12345:12345 --tmpfs /tmp buildkit:buildd-standalone buildd-standalone --addr tcp://0.0.0.0:12345 --root /tmp/buildkit
```
Notes:
* `--privileged` is needed to grant [enough rights](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) to buildkit
* You need to make sure the --root directory exists on a filesystem that is supported by overlay filesystem. e.g. tmpfs, ext4, xfs.
Build a script:
```
$ go build examples/buildkit0
```
Run build script:
On MacOS:
```
$ ./buildkit0 | ./bin/buildctl-darwin --addr tcp://localhost:12345 build
```
On Windows:
```
$ ./buildkit0 | ./bin/buildctl.exe --addr tcp://localhost:12345 build
```
On Linux:
```
$ ./buildkit0 | ./bin/buildctl --addr tcp://localhost:12345 build
```
#### Supported runc version
During development buildkit is tested with the version of runc that is being used by the containerd repository. Please refer to [runc.md](https://github.com/containerd/containerd/blob/d1e11f17ec7b325f89608dd46c128300b8727d50/RUNC.md) for more information.