Docker push - Send image to Docker Hub

Asked

Viewed 955 times

2

all right?

Can anyone help me in the following problem?

I first logged in to Docker, running the command:

$ docker login

Includes registered user and password, but I’m having trouble sending an image to the Docker Hub. When I run the following command:

$ docker push projetofinal2_web

The following error occurs:

The push refers to a repository [docker.io/library/projetofinal2_web]
6e2e1155d419: Preparing 
1cb633a23e71: Preparing 
6b91dd5a05f0: Preparing 
7dc8d752af64: Preparing 
af8b16133eb3: Preparing 
27951393f8e7: Waiting 
f89067d6e30e: Waiting 
5129f19da2c9: Waiting 
34929ec591c4: Waiting 
e02b32b1ff99: Waiting 
f75e64f96dbc: Waiting 
8f7ee6d76fd9: Waiting 
c23711a84ad4: Waiting 
90d1009ce6fe: Waiting 
denied: requested access to the resource is denied

I checked that the image projectofinal2_web actually exists using the command:

$ docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
projetofinal2_web   latest              c27ee5582377        17 minutes ago      983MB
<none>              <none>              082bd1514477        28 hours ago        918MB
<none>              <none>              148f5843aabb        2 days ago          981MB
<none>              <none>              ac09ab02e2f3        2 days ago          981MB
postgres            latest              f9b577fb1ed6        6 days ago          311MB
python              3.6.7               1ec4d11819ad        2 weeks ago         918MB

Project at Github: https://github.com/gabrieldeoliveiraestevam/projeto?files=1

1 answer

1

Following the documentation:

To push a Repository to the Docker Hub, you need to name your local image using your Docker Hub username, and the Repository name that you created in the Previous step [...]

You need to create a tag for use image before climbing:

  • At the time of build: $ docker build -t <hub-user>/<repo-name>[:<tag>] or
  • Image already created: $ docker tag <existing-image> <hub-user>/<repo-name>[:<tag>]

And then to climb to the remote repository:

$ docker push <hub-user>/<repo-name>:<tag>

Where:

  • hub-user: your user in Dockerhub
  • repo-name: the name of the remote repository in Dockerhub
  • existing-image: image already built
  • tag: tag for the image (e. g v1.0)

And in your case, you would do so, for example:

  1. Add to tag in your image:

    $ docker tag projetofinal2_web:latest <seu_usuario_dockerhub>/<seu_repo_dockerhub>:v1.0

  2. And then do the push:

    $ docker push <seu_usuario-dockerhub>/<seu_repo_dockerhub:v0.1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.