Unable to start rancher agent with private registry

Using a local registry for an offline installation using rancher I’m seeing odd behavior. I’m running registry:2.6.2 and pushing all the images to the registry. I am able to start rancher/server with
sudo docker run -d --restart=unless-stopped -p 8080:8080 {registry_dns}:5000/rancher/server:v1.6.11
I then set the registry.default to the registry, create a k8s environment and attempt to add the host with
sudo docker run -e CATTLE_AGENT_IP="172.31.25.56" --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher {registry_dns}:5000/rancher/agent:v1.2.7 http://172.31.25.56:8080/v1/scripts/DF98761C3B0F7C79D9C4:1514678400000:m3jQDSkgwssjtq8wXEEMnRm4vk
The image pulls from the local registry and starts, but never connects. Reviewing the docker logs for the container i see this

INFO: Starting agent for 65D917E29F6E593E79F6
INFO: Access Key: 65D917E29F6E593E79F6
INFO: Config URL: http://172.31.25.56:8080/v1
INFO: Storage URL: http://172.31.25.56:8080/v1
INFO: API URL: http://172.31.25.56:8080/v1
INFO: IP: 172.31.25.56
INFO: Port:
INFO: Required Image: rancher/agent:v1.2.7
INFO: Current Image: {redacted}:5000/rancher/agent:v1.2.7
INFO: Upgrading to image rancher/agent:v1.2.7
Unable to find image 'rancher/agent:v1.2.7' locally

Not sure what I’m missing or should do to prevent the agent from trying to pull itself from docker hub.

Figured out the issue. I was not adding -e CATTLE_BOOTSTRAP_REQUIRED_IMAGE=$PRIVATE_REGISTRY/rancher/agent:v1.2.7 when starting the server container.

http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/no-internet-access/#using-a-private-registry