Docker push - Send the image to the Docker Hub

2

Alright?

Can anyone help me with the following problem?

First I logged in to Docker by running the command:

$ docker login

It includes the registered user and password, however I'm having problems 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 have verified that the image finalfile2_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

GitHub project: link

    
asked by anonymous 05.12.2018 / 02:44

1 answer

0

Following the documentation : p>

  

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 the image before uploading:

  • 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 upload 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 (eg v1.0)

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

  • Add the tag in your image:

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

  • And then do the push :

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

  • 05.12.2018 / 15:12