-
Notifications
You must be signed in to change notification settings - Fork 260
docs: Update README with Docker image generation documentation #3723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 7 commits
2e020c4
139b87e
cecb16b
9aadc9e
f99a9be
7a96168
987ee10
cd8dfda
f0767b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -10,5 +10,101 @@ | |||
| * [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 | ||||
| - **acncli** - CNI manager | ||||
| - **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 <component>-image | ||||
|
|
||||
| # View image name and tag | ||||
| $ make <component>-image-name-and-tag | ||||
|
|
||||
| # Push image to registry | ||||
| $ make <component>-image-push | ||||
|
|
||||
| # Pull image from registry | ||||
| $ make <component>-image-pull | ||||
|
|
||||
| # Build multi-platform manifest | ||||
| $ make <component>-manifest-build | ||||
| $ make <component>-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) | ||||
| - `GOOS` - Target operating system for cross-compilation (default: linux) | ||||
|
||||
| OS ?= $(GOOS) |
GOOS to change OS. Should we be instead manually overwriting OS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, i know i wrote code to parse the platform in to OS/ARCH somewhere, at some point. but you're right, that's not what's happening here now. i think especially for the container builds we should do it.
maybe we default platform as PLATFORM ?= $GOOS/$GOARCH to pick up the host platfom. but if it is set then we should parse $OS and $ARCH out of it, and then set any go invocation GOOS and GOARCH to those.
Uh oh!
There was an error while loading. Please reload this page.