Skip to content

Commit 515a1ec

Browse files
author
Kate Osborn
committed
Add GOARCH note to quickstart and include instructions on setting
1 parent 7626238 commit 515a1ec

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

docs/developer/debugging.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,28 @@ using your IDE.
88

99
- Create a `kind` cluster:
1010

11-
```makefile
11+
```console
1212
make create-kind-cluster
1313
```
1414

15+
- Set GOARCH environment variable:
16+
17+
The [Makefile](/Makefile) uses the GOARCH variable to build the binary and container images. The default value of GOARCH is `amd64`.
18+
19+
If you are deploying NGINX Gateway Fabric on a kind cluster, and the architecture of your machine is not `amd64`, you will want to set the GOARCH variable to the architecture of your local machine. You can find the value of GOARCH by running `go env`. Export the GOARCH variable in your `~/.zshrc` or `~/.bashrc`.
20+
21+
```console
22+
echo "export GOARCH=< Your architecture (e.g. arm64 or amd64) >" >> ~/.bashrc
23+
source ~/.bashrc
24+
```
25+
26+
or for zsh:
27+
28+
```console
29+
echo "export GOARCH=< Your architecture (e.g. arm64 or amd64) >" >> ~/.zshrc
30+
source ~/.zshrc
31+
```
32+
1533
- Build debug images and install NGF on your kind cluster:
1634

1735
- **For NGINX OSS:**

docs/developer/quickstart.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,30 @@ Follow these steps to set up your development environment.
5151

5252
## Build the Binary and Images
5353

54+
### Setting GOARCH
55+
56+
The [Makefile](/Makefile) uses the GOARCH variable to build the binary and container images. The default value of GOARCH is `amd64`.
57+
58+
If you are deploying NGINX Gateway Fabric on a kind cluster, and the architecture of your machine is not `amd64`, you will want to set the GOARCH variable to the architecture of your local machine. You can find the value of GOARCH by running `go env`. Export the GOARCH variable in your `~/.zshrc` or `~/.bashrc`.
59+
60+
```shell
61+
echo "export GOARCH=< Your architecture (e.g. arm64 or amd64) >" >> ~/.bashrc
62+
source ~/.bashrc
63+
```
64+
65+
or for zsh:
66+
67+
```shell
68+
echo "export GOARCH=< Your architecture (e.g. arm64 or amd64) >" >> ~/.zshrc
69+
source ~/.zshrc
70+
```
71+
5472
### Build the Binary
5573

5674
To build the binary, run the make build command from the project's root directory:
5775
5876
```makefile
59-
make build
77+
make GOARCH=$GOARCH build
6078
```
6179
6280
This command will build the binary and output it to the `/build/.out` directory.
@@ -66,7 +84,7 @@ This command will build the binary and output it to the `/build/.out` directory.
6684
To build the NGINX Gateway Fabric and NGINX container images from source run the following make command:
6785
6886
```makefile
69-
make TAG=$(whoami) build-images
87+
make GOARCH=$GOARCH TAG=$(whoami) build-images
7088
```
7189
7290
This will build the docker images `nginx-gateway-fabric:<your-user>` and `nginx-gateway-fabric/nginx:<your-user>`.

0 commit comments

Comments
 (0)