Docker Cookbook


| Chapter 2: Image Creation and Sharing



Download 6,31 Mb.
Pdf ko'rish
bet54/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   50   51   52   53   54   55   56   57   ...   260
Bog'liq
Docker Cookbook

54 | Chapter 2: Image Creation and Sharing


2.9 Publishing Your Image to Docker Hub
Problem
You write a Dockerfile and build an image for a useful container. You want to share
this image with everyone.
Solution
Share this image on the 
Docker Hub
. Docker Hub is to Docker what 
GitHub
is to
source code. It allows anyone to host its image online and share it publicly or keep it
private. To share an image on Docker Hub, you need to do the following:
• Create an account on Docker Hub.
• Log in to the hub on your Docker host.
• Push your image.
Let’s get started. Registering requires only a valid email address. Head over to the
signup page
 and create an account. After verifying the email address that you used to
create the account, your registration will be complete. This free account will allow
you to publish public images as well as have one private repository. If you want to
have more than one private repository, you will need to pay a subscription.
Now that you have an account created, you can head back to your Docker host, select
one of your images, and use the Docker CLI to publish this image on your public
repository. This will be a three-step process:
1. Log in with 
docker login
. This will ask for your Docker Hub credentials.
2. Tag an existing image with your username from Docker Hub.
3. Push the newly tagged image.
The login step will store your Docker Hub credentials in a 
~/.dockercfg
file:
$ docker login
Username: how2dock
Password:
Email: how2dock@gmail.com
Login Succeeded
$ cat ~/.dockercfg
{"https://index.docker.io/v1/":{"auth":"..........",
"email":"how2dock@gmail.com"}}
If you check the list of images that you currently have, you see that your Flask image
from 
Recipe 2.4
 is using a local repository and has a tag called 
latest
:

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   50   51   52   53   54   55   56   57   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish