Skip to content

Commit

Permalink
docs: contributing docs update for cross comp
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Aug 20, 2022
1 parent c9c4bf7 commit 01ca536
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/contributing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
* (Optional) [Configure project for IDE](set-up-ide.md)
* [Configure Git for contributing](set-up-git.md)
* [Work with a development container](set-up-dev-env.md)
* [Containerized build and cross compilation](ctn-build.md)
* [Run tests and test documentation](test.md)
* [Debugging the daemon](debug.md)
35 changes: 35 additions & 0 deletions docs/contributing/ctn-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
The `Dockerfile` supports building and cross compiling docker daemon and extra
tools using [Docker Buildx](https://github.com/docker/buildx) and [BuildKit](https://github.com/moby/buildkit).
A [bake definition](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md)
named `docker-bake.hcl` is in place to ease the build process:

```shell
# build binaries for the current host platform
# output to ./bundles/binary by default
docker buildx bake

# build binaries for the current host platform
# output to ./bin
DESTDIR=./bin docker buildx bake

# build dynamically linked binaries
# output to ./bundles/dynbinary by default
DOCKER_LINKMODE=dynamic docker buildx bake

# build binaries for all supported platforms
docker buildx bake binary-cross

# build binaries for a specific platform
docker buildx bake --set *.platform=linux/arm64

# build all for the current host platform (binaries + containerd, runc, tini, ...)
# output to ./bundles/all by default
docker buildx bake all

# build all for the current host platform
# output to ./bin
DESTDIR=./bin docker buildx bake all

# build all for all supported platforms
docker buildx bake all-cross
```

0 comments on commit 01ca536

Please sign in to comment.