docs: contributing docs update for cross comp

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 83280d44d0)
This commit is contained in:
CrazyMax 2022-08-20 13:58:04 +02:00
parent 2dd577955c
commit d778bbab84
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
2 changed files with 29 additions and 0 deletions

View file

@ -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)

View file

@ -0,0 +1,28 @@
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://docs.docker.com/build/bake/file-definition/) named
`docker-bake.hcl` is in place to ease the build process:
```shell
# build binaries for the current host platform
# output to ./bundles/binary-daemon by default
docker buildx bake
# or
docker buildx bake binary
# build binaries for the current host platform
# output to ./bin
DESTDIR=./bin docker buildx bake
# build dynamically linked binaries
# output to ./bundles/dynbinary-daemon by default
DOCKER_STATIC=0 docker buildx bake
# or
docker buildx bake dynbinary
# build binaries for all supported platforms
docker buildx bake binary-cross
# build binaries for a specific platform
docker buildx bake --set *.platform=linux/arm64
```