How to build rancher from source?


I have to make an update to the source code of rancher and haven’t found instructions on how to actually build the rancher docker image from source code. Specifically, I want to swap the aws-sdk-go for a custom built aws-sdk-go.

I have tried compiling the source code by running the make build command. When the build finishes, I can see the executables for rancher and agent generated in the bin directory. To build the rancher and rancher-agent docker image, I copy those executables out to the package folder and then run docker builds on the package folder respectively for rancher and rancher-agent.When those docker builds are completed, I am left with what appears to be the rancher and rancher-agent docker images. However, after running the rancher image in my air-gapped environment, I cannot reach the rancher UI.

Specifically, the error I observe in the rancher logs is:

[ERROR] failed to serve UI: Get dial tcp [2606:4700:20::6818:1133]:443: socket: address family not supported by protocol

Why is the compiled rancher server looking for this html on the internet? Shouldn’t it be stored locally?

UPDATE: I just noticed that the last commit to the scripts/build-server file has the message:

"Fix UI can not open in dev version"

This looks relevant to my issue. Is there anyway I can get around this? Also, is there a way to not have to tag my rancher-agent with :dev to get this custom built rancher server and agent working together? The version of the rancher-agent that is used when I run the custom rancher-server is always defaulted to :dev but I would rather have it tagged with the same version I tag the rancher-server.

Any help is appreciated.

Thanks so much,