diff --git a/README.md b/README.md index 75630fdbbb..725b61f46d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ $ make all-binaries Then follow the instructions for the plugin in [Documentation](docs/). +## Docker Image Generation +See [Docker Image Generation](docs/README.md#docker-image-generation) for instructions on building container images for networking components. + ## Contributions Contributions in the form of bug reports, feature requests and PRs are always welcome. diff --git a/docs/README.md b/docs/README.md index 438ff3a584..72ca170352 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,5 +10,64 @@ * [NPM](npm.md) - describes how to setup Azure-NPM (Azure Network Policy Manager). * [Scripts](scripts.md) - describes how to use the scripts in this repository. +## Docker Image Generation + +This repository supports building Docker container images for networking components using standardized make recipes. The build system uses Docker or Podman to create multi-platform images. + +### Prerequisites +- Docker or Podman installed and running +- For multi-platform builds: `make qemu-user-static` (Linux only) + +### Available Components +- **azure-ipam** - Azure IP Address Management +- **cni** - Container Network Interface +- **cns** - Container Network Service +- **npm** - Network Policy Manager +- **ipv6-hp-bpf** - IPv6 Host Policy BPF + +### Generic Build Pattern +All components follow the same make recipe pattern: + +```bash +# Build container image +$ make -image + +# View image name and tag +$ make -image-name-and-tag + +# Push image to registry +$ make -image-push + +# Pull image from registry +$ make -image-pull + +# Build multi-platform manifest +$ make -manifest-build +$ make -manifest-push +``` + +### Example Usage +```bash +# Build CNS image +$ make cns-image + +# Build NPM image with custom platform +$ PLATFORM=linux/arm64 make npm-image + +# Build Azure-IPAM image with custom registry +$ IMAGE_REGISTRY=myregistry.azurecr.io make azure-ipam-image + +# Use Podman instead of Docker +$ CONTAINER_BUILDER=podman make cni-image +``` + +### Customization +Environment variables for customizing builds: +- `PLATFORM` - Target platform/architecture (default: linux/amd64) +- `IMAGE_REGISTRY` - Custom registry (default: acnpublic.azurecr.io) +- `CONTAINER_BUILDER` - Container builder (default: docker, alternative: podman) + +Images are tagged with platform and version information and published to the configured registry. + ## Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.