0

Can we push different multiple images to same docker hub repository?

For example: I have 2 images Mysql and ubuntu and only one repository name is demo. I want to push mysql and ubuntu image to demo repository. How can we achieve this?

  • you can use tags to separate between images, call them demo:mysql, demo:ubuntu. Although yo should have different repositories one for mysql and one for ubuntu – Gal I. Sep 28 '21 at 18:05
  • https://stackoverflow.com/questions/28349392/how-to-push-a-docker-image-to-a-private-repository – Saeed Sep 28 '21 at 18:05
  • You can have multiple images, each with their own tag sets on docker hub. If your username is 'swapnil', you can have `swapnil/database:latest` and `swapnil/ubuntu:20.04` for instance. More info here https://docs.docker.com/docker-hub/repos/#pushing-a-docker-container-image-to-docker-hub – Hans Kilian Sep 28 '21 at 18:18
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 07 '21 at 09:20

1 Answers1

0

consider to do it in this way (works on my side):

docker image tag your_image_name:version your_account_name_dockerhub/image_name:version

docker image push your_account_name_dockerhub/image_name:version

for example:

docker image tag nginx:latest myname/nginx:latest
docker image push myname/nginx:latest
macosmi
  • 104
  • 5