Hi there,
You have to understand the following: your CI job is executed INSIDE of a container on a VM where is the runner. Very likely, this VM is not the VM where you want to deploy your image to.
In order to deploy, you have to do what you would normally do - ssh into the target VM (where you want to deploy) and then run docker login
, docker pull
and docker run
or whatever you need to deploy.
There are plenty of examples on forum how to do this, e.g.: Question on Deploy phase of gitlab-ci.yaml - #2 by paula.kokic
Hope this helps!
P.S. If you DO want to deploy the image on exactly the same VM as your runner (which is not normally the use case), it would be better to use shell executor → then your commands would be executed directly on the VM instead of a container.