Skip to content

Commit 9887fa7

Browse files
committed
docs: add running instruction to CONTRIBUTING.md
Signed-off-by: Justin Chadwell <[email protected]>
1 parent 055e59f commit 9887fa7

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,72 @@ To build containerized `moby/buildkit:local` and `moby/buildkit:local-rootless`
6262
make images
6363
```
6464

65+
### Run BuildKit
66+
67+
You can launch the backend BuildKit daemon either in a container, or directly:
68+
69+
```bash
70+
# run the daemon in a container
71+
$ docker run --rm -d --name buildkitd --privileged moby/buildkit:local
72+
$ export BUILDKIT_HOST=docker-container://buildkitd
73+
$ buildctl debug info
74+
BuildKit: github.com/moby/buildkit v0.11.0-rc3-623-g2ff0d2a2f.m 2ff0d2a2f53663aae917980fa27eada7950ff69c.m
75+
```
76+
77+
```bash
78+
# run the daemon directly (only on linux)
79+
$ sudo buildkitd
80+
$ export BUILDKIT_HOST=unix:///run/buildkit/buildkitd.sock
81+
$ sudo buildctl debug info
82+
BuildKit: github.com/moby/buildkit v0.11.0-rc3-506-g539bab193.m 539bab193c28d3ce731e6013f471ba24848f5c41.m
83+
```
84+
85+
You can also connect buildx to the BuildKit daemon using the [`remote` driver](https://docs.docker.com/build/drivers/remote/):
86+
87+
```bash
88+
$ docker buildx create --driver=remote --name=dev $BUILDKIT_HOST
89+
$ docker buildx --builder=dev inspect
90+
Name: dev
91+
Driver: remote
92+
Last Activity: 2023-06-06 14:15:52 +0000 UTC
93+
94+
Nodes:
95+
Name: dev0
96+
Endpoint: tcp://localhost:1234
97+
Status: running
98+
Buildkit: v0.11.0-rc3-506-g539bab193.m
99+
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
100+
```
101+
102+
### Run BuildKit using Buildx
103+
104+
You can also have buildx run and manage the custom BuildKit daemon itself using
105+
the [`docker-container` driver](https://docs.docker.com/build/drivers/remote/).
106+
107+
This is usually the easiest way to get started with a custom BuildKit daemon
108+
for development or debugging.
109+
110+
```bash
111+
$ docker buildx rm dev || true # remove previous dev builder if exists
112+
$ docker buildx create --driver=docker-container --name=dev --driver-opt image=moby/buildkit:local --bootstrap
113+
[+] Building 0.3s (1/1) FINISHED
114+
=> [internal] booting buildkit
115+
=> => starting container buildx_buildkit_dev0
116+
dev
117+
$ docker buildx --builder=dev inspect
118+
Name: dev
119+
Driver: docker-container
120+
Last Activity: 2023-06-06 14:15:52 +0000 UTC
121+
122+
Nodes:
123+
Name: dev0
124+
Endpoint: desktop-linux
125+
Driver Options: image="moby/buildkit:local"
126+
Status: running
127+
Buildkit: v0.11.0-rc3-623-g2ff0d2a2f.m
128+
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
129+
```
130+
65131
### Run the unit- and integration-tests
66132

67133
Running tests:

0 commit comments

Comments
 (0)