Build NGINX Gateway Fabric
While most users will install NGINX Gateway Fabric with Helm or Kubernetes manifests, manually building the NGINX Gateway Fabric and NGINX images can be helpful for testing and development purposes. Follow the steps in this document to build the NGINX Gateway Fabric and NGINX images.
Before you can build the NGINX Gateway Fabric and NGINX images, make sure you have the following software installed on your machine:
If building the NGINX Plus image, you will also need a valid NGINX Plus license certificate (nginx-repo.crt
) and key (nginx-repo.key
) in the root of the repo.
-
Clone the repo and change into the
nginx-gateway-fabric
directory:shell git clone https://github.com/nginx/nginx-gateway-fabric.git --branch v2.1.4 cd nginx-gateway-fabric
-
Build the images:
-
To build both the NGINX Gateway Fabric and NGINX images:
makefile make PREFIX=myregistry.example.com/nginx-gateway-fabric build-prod-images
-
To build both the NGINX Gateway Fabric and NGINX Plus images:
makefile make PREFIX=myregistry.example.com/nginx-gateway-fabric build-prod-images-with-plus
-
To build just the NGINX Gateway Fabric image:
makefile make PREFIX=myregistry.example.com/nginx-gateway-fabric build-prod-ngf-image
-
To build just the NGINX image:
makefile make PREFIX=myregistry.example.com/nginx-gateway-fabric build-prod-nginx-image
-
To build just the NGINX Plus image:
makefile make PREFIX=myregistry.example.com/nginx-gateway-fabric/nginx-plus build-prod-nginx-plus-image
Set the
PREFIX
variable to the name of the registry you’d like to push the image to. By default, the images will be namednginx-gateway-fabric:2.1.4
andnginx-gateway-fabric/nginx:2.1.4
ornginx-gateway-fabric/nginx-plus:2.1.4
. -
-
Push the images to your container registry:
shell docker push myregistry.example.com/nginx-gateway-fabric:2.1.4 docker push myregistry.example.com/nginx-gateway-fabric/nginx:2.1.4
or
shell docker push myregistry.example.com/nginx-gateway-fabric:2.1.4 docker push myregistry.example.com/nginx-gateway-fabric/nginx-plus:2.1.4
Make sure to substitute
myregistry.example.com/nginx-gateway-fabric
with your registry.