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="" --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
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:
INFO: Storage URL:
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.