Skip to content
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

Document how to build a custom image #250

Merged
merged 1 commit into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DOCKERFILE?=Dockerfile

CRD_BASES=./config/crd/bases

export APP_NAME=sriov-network-operator
export APP_NAME?=sriov-network-operator
TARGET=$(TARGET_DIR)/bin/$(APP_NAME)
IMAGE_TAG?=ghcr.io/k8snetworkplumbingwg/$(APP_NAME):latest
MAIN_PKG=cmd/manager/main.go
Expand Down
26 changes: 26 additions & 0 deletions doc/hacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,29 @@ Identify controller-runtime version referenced by kubebuilder
Check controller-runtime's go.mod file

As a result, we can determine the versions of the k8s dependencies in the operator's go.mod.

## Build an custom image

To build the SR-IOV network operator container image:

```bash
make image

If you want to build another image (e.g. webhook or config-daemon), you'll need to do
the following:

```bash
export DOCKERFILE=Dockerfile.sriov-network-config-daemon
export APP_NAME=sriov-network-config-daemon
make image

export DOCKERFILE=Dockerfile.webhook
export APP_NAME=sriov-network-webhook
make image

Then you'll need to push the image to a registry using e.g. `buildah push`.
Before deploying the Operator, you want to export these variables to use that custom image:

```bash
export SRIOV_NETWORK_CONFIG_DAEMON_IMAGE=<path to custom image>
(...)