Once the image is created, it is important to share and publish. You can publish your own images to the Docker hub, or you can publish them to your own private Docker hub.
To publish the image to the Dokcer hub, first register the account on the Dokcer hub and register on this machine (which is ready to submit the mirror to the Docker hub). The process is as follows:
1, Login https://hub.docker.com/website to register a user, such as Jeme. A mailbox is required for verification when registering.
2. Register (login) with Docker login on this machine, such as:
[Email protected]:~$ Docker Login
Username:jeme
Password:
Email: [Email protected]
Warning:login Credentials Saved In/home/xxx/.docker/config.json
Login succeeded
Description: Once verified, the locally created image can be started to be published to the Docker Hub's own account.
You can exit the Docker hub via the Docker logout command, and you cannot post the image to the Docker hub after exiting, unless you register again.
3. Release image
Docker push user name/warehouse name [: Tag name]
Here the user name/warehouse name [: Tag name] Represents the image must be the local presence, tag name does not write the default is latest. This means that the name must be in canonical format (plus user name) when creating the image.
And the user name is the name that you registered on the Docker hub. As the jeme here.
When the release was successful, we used Docker search to search for the image we had mentioned.
Docker Learning Note 7: Publishing images to the Docker hub