'Docker image is not sent to remote server

I have built a docker image in local server and I want it to deploy in remote server. I have tried SSH authentication before script in stage:deploy . I have attached the before script below. now i have error in remote server which states

before_script:
    - /usr/bin/ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
script:
 -  ssh root@hostid 'docker run --name image -dp 80:80 image'
 - echo "deployment complete"

Unable to find image 'image:latest' locally docker: Error response from daemon: pull access denied for image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

How can i resolve this issue??



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source