# Subir imagen a DockerHub

El siguiente paso lógico después de crear una nueva imagen de una imagen existente es compartirla con algunos pocos de tus amigos, el mundo entero en Docker Hub u otro registro de Docker al que tenga acceso. Para hacer push de una imagen a Docker Hub o cualquier otro registro de Docker, debe tener una cuenta allí.

Esta sección le muestra cómo hacer push desde una imagen Docker a Docker Hub. Para saber cómo crear su propio registro de Docker privado, consulte[¿cómo configurar un registro de Docker privado en Ubuntu 14.04?](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04).

Para crear una cuenta en Docker Hub, regístrese en[Docker Hub](https://hub.docker.com/). Después, para hacer push a su imagen, primero ingrese en Docker Hub. Se le pedirá que se autentique:

```
docker login -u docker-registry-username
```

```
```

Si especificó la contraseña correcta, la autenticación debería tener éxito. Entonces usted puede hacer push a su propia imagen usando:

```
docker push docker-registry-username/docker-image-name
```

Se tardará algún tiempo en completarse, y cuando se complete, la salida será similar a la siguiente:

Después de hacer push de una imagen a un registro, debe aparecer en el tablero de la cuenta, como en la imagen de abajo.

```
Output
The push refers to a repository [docker.io/finid/ubuntu-nodejs]
e3fbbfb44187: Pushed
5f70bf18a086: Pushed
a3b5c80a4eba: Pushed
7f18b442972b: Pushed
3ce512daaf78: Pushed
7aae4540b42d: Pushed
```

Después de subir una imagen al registro, debería aparecer en la lista de su cuenta, como se muestra en la imagen de abajo.

![](/files/-Lc1Ww7CW1ZbwId7K--x)

Si un intento de push resulta en un error de este tipo, es probable que no haya iniciado sesión:

```
Output
The push refers to a repository [docker.io/finid/ubuntu-nodejs]
e3fbbfb44187: Preparing
5f70bf18a086: Preparing
a3b5c80a4eba: Preparing
7f18b442972b: Preparing
3ce512daaf78: Preparing
7aae4540b42d: Waiting
unauthorized: authentication required
```

Inicie sesión y repita el intento de push.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avbravo-2.gitbook.io/docker/chapter1/subir-imagen-a-dockerhub.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
