|
10 | 10 | * [NPM](npm.md) - describes how to setup Azure-NPM (Azure Network Policy Manager). |
11 | 11 | * [Scripts](scripts.md) - describes how to use the scripts in this repository. |
12 | 12 |
|
| 13 | +## Docker Image Generation |
| 14 | + |
| 15 | +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. |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | +- Docker or Podman installed and running |
| 19 | +- For multi-platform builds: `make qemu-user-static` (Linux only) |
| 20 | + |
| 21 | +### Available Components |
| 22 | +- **acncli** - CNI manager |
| 23 | +- **azure-ipam** - Azure IP Address Management |
| 24 | +- **cni** - Container Network Interface |
| 25 | +- **cns** - Container Network Service |
| 26 | +- **npm** - Network Policy Manager |
| 27 | +- **ipv6-hp-bpf** - IPv6 Host Policy BPF |
| 28 | + |
| 29 | +### Generic Build Pattern |
| 30 | +All components follow the same make recipe pattern: |
| 31 | + |
| 32 | +```bash |
| 33 | +# Build container image |
| 34 | +$ make <component>-image |
| 35 | + |
| 36 | +# View image name and tag |
| 37 | +$ make <component>-image-name-and-tag |
| 38 | + |
| 39 | +# Push image to registry |
| 40 | +$ make <component>-image-push |
| 41 | + |
| 42 | +# Pull image from registry |
| 43 | +$ make <component>-image-pull |
| 44 | + |
| 45 | +# Build multi-platform manifest |
| 46 | +$ make <component>-manifest-build |
| 47 | +$ make <component>-manifest-push |
| 48 | +``` |
| 49 | + |
| 50 | +### Example Usage |
| 51 | +```bash |
| 52 | +# Build CNS image |
| 53 | +$ make cns-image |
| 54 | + |
| 55 | +# Build NPM image with custom platform |
| 56 | +$ PLATFORM=linux/arm64 make npm-image |
| 57 | + |
| 58 | +# Build Azure-IPAM image with custom registry |
| 59 | +$ IMAGE_REGISTRY=myregistry.azurecr.io make azure-ipam-image |
| 60 | + |
| 61 | +# Use Podman instead of Docker |
| 62 | +$ CONTAINER_BUILDER=podman make cni-image |
| 63 | +``` |
| 64 | + |
| 65 | +### Customization |
| 66 | +Environment variables for customizing builds: |
| 67 | +- `PLATFORM` - Target platform/architecture (default: linux/amd64) |
| 68 | +- `IMAGE_REGISTRY` - Custom registry (default: acnpublic.azurecr.io) |
| 69 | +- `CONTAINER_BUILDER` - Container builder (default: docker, alternative: podman) |
| 70 | + |
| 71 | +Images are tagged with platform and version information and published to the configured registry. |
| 72 | + |
13 | 73 | ## Code of Conduct |
14 | 74 | 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. |
0 commit comments