Skip to content

Commit

Permalink
Add GOARCH note to quickstart and include instructions on setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-osborn committed Jan 3, 2024
1 parent 7626238 commit 515a1ec
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
20 changes: 19 additions & 1 deletion docs/developer/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,28 @@ using your IDE.

- Create a `kind` cluster:

```makefile
```console
make create-kind-cluster
```

- Set GOARCH environment variable:

The [Makefile](/Makefile) uses the GOARCH variable to build the binary and container images. The default value of GOARCH is `amd64`.

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`.

```console
echo "export GOARCH=< Your architecture (e.g. arm64 or amd64) >" >> ~/.bashrc
source ~/.bashrc
```

or for zsh:

```console
echo "export GOARCH=< Your architecture (e.g. arm64 or amd64) >" >> ~/.zshrc
source ~/.zshrc
```

- Build debug images and install NGF on your kind cluster:

- **For NGINX OSS:**
Expand Down
22 changes: 20 additions & 2 deletions docs/developer/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,30 @@ Follow these steps to set up your development environment.

## Build the Binary and Images

### Setting GOARCH

The [Makefile](/Makefile) uses the GOARCH variable to build the binary and container images. The default value of GOARCH is `amd64`.

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`.

```shell
echo "export GOARCH=< Your architecture (e.g. arm64 or amd64) >" >> ~/.bashrc
source ~/.bashrc
```

or for zsh:

```shell
echo "export GOARCH=< Your architecture (e.g. arm64 or amd64) >" >> ~/.zshrc
source ~/.zshrc
```

### Build the Binary

To build the binary, run the make build command from the project's root directory:
```makefile
make build
make GOARCH=$GOARCH build
```
This command will build the binary and output it to the `/build/.out` directory.
Expand All @@ -66,7 +84,7 @@ This command will build the binary and output it to the `/build/.out` directory.
To build the NGINX Gateway Fabric and NGINX container images from source run the following make command:
```makefile
make TAG=$(whoami) build-images
make GOARCH=$GOARCH TAG=$(whoami) build-images
```
This will build the docker images `nginx-gateway-fabric:<your-user>` and `nginx-gateway-fabric/nginx:<your-user>`.
Expand Down

0 comments on commit 515a1ec

Please sign in to comment.