Answer a question

I am new to docker. I have the following two docker image files that I downloaded from docker hub

(1) Cassandra:3 
(2) Kong

I have Gitlab Repository into which I want to push these two images. I am able to connect to the Gitlab Registry. I am trying to push the Cassandra:3 Image using the following command.

docker push registry-gitlab.mycompany.com/username/myproject/cassandra:3

When I execute the above command I get the following error.

 The push refers to repository [registry-gitlab.mycompany.com/username/myproject/cassandra]
An image does not exist locally with the tag: registry-gitlab.mycompany.com/username/myproject/cassandra

There is an image called cassandra with tag 3 in the system where I am executing the push command. After going through similar questions in stackoverflow, I assume that this relates to Tag name, but I am not sure what should be the tag name to be assigned to this image or whether updating tags will have any issue.

Answers

First you have to tag the docker image,

docker tag Cassandra:3 registry-gitlab.mycompany.com/username/myproject/cassandra:3

Then you can push

docker push registry-gitlab.mycompany.com/username/myproject/cassandra:3
Logo

云原生社区为您提供最前沿的新闻资讯和知识内容

更多推荐