You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Devtools Week] Multi-platform support for build binary and container images (#68)
* add target arch support to build container make rules
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
* update manager rule to build for other platforms
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
* update env variables table in README
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
* add 'Using other platforms' section to contributing guide
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
* fix OpenShift CI: set default target arch build arg to 'amd64'
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
---------
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+40-1Lines changed: 40 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -60,9 +60,48 @@ The Makefile currently supports both Docker and Podman. To run the proper comman
60
60
61
61
By default, http/2 on the webhook server is disabled due to [CVE-2023-44487](https://github.com/advisories/GHSA-qppj-fm5r-hxr3).
62
62
63
-
If you want to enable http/2 for the webhook server, build with `ENABLE_WEBHOOK_HTTP2=true make docker-build` or with
63
+
If you want to enable http/2 for the webhook server, build with `ENABLE_WEBHOOK_HTTP2=true make <engine>-build` or with
64
64
`ENABLE_WEBHOOK_HTTP2=true make run` if running locally.
65
65
66
+
##### Using other platforms
67
+
68
+
If you need to target another platform for container builds, such as Apple silicon, you can use `TARGET_ARCH=<architecture> make <engine>-build`.
69
+
70
+
For example, to target container build to `arm64` run the following:
71
+
72
+
```sh
73
+
TARGET_ARCH=arm64 make <engine>-build
74
+
```
75
+
76
+
**Note:** Container builds only use `linux` as the operating system as local cluster runtime environments, such as `minikube` environments, run under Linux virtual machines for other operating systems. For example, _Apple silicon_ would just use the `arm64` container build.
77
+
78
+
For local builds, you can also set the target operating system:
79
+
80
+
**Apple silicon**
81
+
82
+
```sh
83
+
export TARGET_OS=darwin
84
+
export TARGET_ARCH=arm64
85
+
make manager
86
+
```
87
+
88
+
**Linux ARM**
89
+
90
+
```sh
91
+
export TARGET_ARCH=arm64
92
+
make manager
93
+
```
94
+
95
+
**Windows**
96
+
97
+
```sh
98
+
export TARGET_OS=windows
99
+
export TARGET_ARCH=amd64
100
+
make manager
101
+
```
102
+
103
+
By default, `amd64` is used for the target architecture and `linux` is used for the target operating system.
104
+
66
105
### Testing your Changes
67
106
68
107
All changes delivered to the Devfile Registry Operator are expected to be sufficiently tested. This may include validating that existing tests pass, updating tests, or adding new tests.
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,27 @@ The repository contains a Makefile; building and deploying can be configured via
64
64
|variable|purpose|default value|
65
65
|---|---|---|
66
66
|`IMG`| Image used for controller (run makefile, if `IMG` is updated) |`quay.io/devfile/registry-operator:next`|
67
+
|`BUNDLE_IMG`| Image used for bundle OLM package |`quay.io/devfile/registry-operator-bundle:<latest_version>`|
68
+
|`CERT_MANAGER_VERSION`| Version of `cert-manager` installed using `make install-cert`|`v1.11.0`|
69
+
|`ENABLE_WEBHOOKS`| If `false`, disables operator webhooks |`true`|
70
+
|`ENABLE_WEBHOOK_HTTP2`| Overrides webhook HTTP server deployment to use http/2 if set to `true`, **not recommended**|`false`|
71
+
|`BUNDLE_CHANNELS`| Sets the list channel(s) include bundle build under |`alpha`|
72
+
|`BUNDLE_DEFAULT_CHANNEL`| Sets the default channel to use when installing the bundle ||
73
+
|`ENVTEST_K8S_VERSION`| Version of k8s to use for the test environment |`1.26` (current) |
74
+
|`CONTROLLER_TOOLS_VERSION`| Version of the controller tools |`v0.9.2`|
75
+
|`KUSTOMIZE_VERSION`| Version of kustomize |`v3.8.7`|
76
+
|`GOBIN`| Path to install Go binaries to |`${GOPATH}/bin`|
77
+
|`K8S_CLI`| Path to CLI tool to use with the target cluster environment, `kubectl` or `oc`| Either `oc` or `kubectl` if installed in that order |
78
+
|`OPERATOR_SDK_CLI`| CLI path to `operator-sdk` tool |`operator-sdk`|
79
+
|`SHELL`| Active shell to use with make |`/usr/bin/env bash -o pipefail`|
80
+
|`LOCALBIN`| Path to place project binaries |`./bin`|
81
+
|`KUSTOMIZE`| Path to target `kustomize` binary |`${LOCALBIN}/kustomize`|
82
+
|`CONTROLLER_GEN`| Path to target `controller-gen` binary |`${LOCALBIN}/controller-gen`|
83
+
|`ENVTEST`| Path to target `setup-envtest` binary |`${LOCALBIN}/setup-envtest`|
84
+
|`TARGET_ARCH`| Target architecture for operator manager builds, possible values: `amd64`, `arm64`, `s390x`, `ppc64le`|`amd64`|
85
+
|`TARGET_OS`| Target operating system for operator manager build, **only for `make manager`**|`linux`|
86
+
|`PLATFORMS`| Target architecture(s) for `make docker-buildx`| All supported: `linux/arm64,linux/amd64,linux/s390x,linux/ppc64le`|
87
+
|`KUSTOMIZE_INSTALL_SCRIPT`| URL of kustomize installation script, see [kustomize installation instructions](https://kubectl.docs.kubernetes.io/installation/kustomize/binaries/)|`https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh`|
0 commit comments