Build the ForgeRock IoT Gateway

ForgeRock does not deliver binaries for the IoT Gateway. There are simply too many operating system and architecture combinations to support. The IoT Gateway and the IoT SDK are developed in the Go programming language primarily because it has uncomplicated build tooling and good support for cross-compilation to target systems.

Build the IoT Gateway on a Target System

These steps assume that you have installed the required software and cloned the Things GitHub repository:

  1. On your target system, navigate to the iot-edge directory:

    cd /path/to/iot-edge
  2. Build the IoT Gateway binary:

    go build -o ./bin/gateway ./cmd/gateway

    The IoT Gateway binary is now available at bin/gateway.

  3. (Optional) Run the IoT Gateway with the --help flag for available command-line options:

    ./bin/gateway --help
    Usage:
     gateway [OPTIONS]
    
     Application Options:
     --url=      AM URL
     --realm=    AM Realm
     --audience= JWT Audience
     --tree=     Authentication tree
     --name=     Gateway name
     --address=  CoAP Address of Gateway
     --key=      The file containing the Gateway's signing key
     --kid=      The Gateway's signing key ID
     --cert=     The file containing the Gateway's certificate
     --timeout=  Timeout for AM communications (default: 5s)
     -d, --debug     Switch on debug
    
     Help Options:
     -h, --help      Show this help message
    
     2020/08/28 10:40:33 Usage:
     gateway [OPTIONS]
    
     Application Options:
     --url=      AM URL
     --realm=    AM Realm
     --audience= JWT Audience
     --tree=     Authentication tree
     --name=     Gateway name
     --address=  CoAP Address of Gateway
     --key=      The file containing the Gateway's signing key
     --kid=      The Gateway's signing key ID
     --cert=     The file containing the Gateway's certificate
     --timeout=  Timeout for AM communications (default: 5s)
     -d, --debug     Switch on debug
    
     Help Options:
     -h, --help      Show this help message
Cross-Compile the IoT Gateway for a Target System

You can specify a target system with a combination of the $GOOS and $GOARCH environment variables. This lets you build the IoT Gateway for a variety of operating system and architecture combinations.

For example, to run the IoT Gateway on an arm 32-bit processor (for example, a Raspberry Pi 3 running in 32-bit mode), build the IoT Gateway for linux/arm, as follows:

  1. GOOS=linux GOARCH=arm go build -o ./bin/gateway ./cmd/gateway
  2. (Optional) For a complete list of environment and cross-compilation targets, see the go Documentation.

    For more build options, see the go command environment variables

Read a different version of :