Docker Cookbook


Publishing Your Image to Docker Hub | 55



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

2.9 Publishing Your Image to Docker Hub | 55


$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
flask latest 88d6464d1f42 5 days ago 354.6 MB
...
To push this image to your Docker Hub account, you need to tag this image with
your own Docker Hub repository with the 
docker tag
 command (see 
Recipe 2.6
):
$ docker tag flask how2dock/flask
sebimac:flask sebgoa$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
flask latest 88d6464d1f42 5 days ago 354.6 MB
how2dock/flask latest 88d6464d1f42 5 days ago 354.6 MB
You now have your Flask image with the repository of 
how2dock/flask
, which follows
the proper naming convention for repositories. You are ready to push the image.
Docker will attempt to push the various layers that make the image; if the layer is pre-
existing on the Docker Hub, it will skip it. Once the push is finished, the 
how2dock/
flask
image will be visible in your Docker Hub page, and anyone will be able to
docker pull how2dock/flask
 (see 
Figure 2-1
):
$ docker push how2dock/flask
The push refers to a repository [how2dock/flask] (len: 1)
Sending image list
Pushing repository how2dock/flask (1 tags)
511136ea3c5a: Image already pushed, skipping
01bf15a18638: Image already pushed, skipping
...
dc4a9a43bb7f: Image successfully pushed
e394b9fbe3fa: Image successfully pushed
3f7abcdc10d4: Image successfully pushed
88d6464d1f42: Image successfully pushed
Pushing tag for rev [88d6464d1f42] on
{https://cdn-registry-1.docker.io/v1/repositories/how2dock/flask/tags/latest}
56 | Chapter 2: Image Creation and Sharing


Figure 2-1. Docker Hub Flask image
Discussion
The 
docker tag
command allows you to change the repository and tag of an image.
In this example, you did not specify a tag, so Docker assigned it the 
latest
tag. You
could choose to specify tags and push these to Docker Hub, maintaining several ver‐
sions of an image in the same repository.
This recipe introduced two new docker CLI commands: 
docker tag
and 
docker
push
. One more is worth noting, in terms of image management: 
docker search
. It
allows you to search for images in Docker Hub. For example, if you are looking for an
image that would give you 
postgres
:
$ docker search postgres
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
postgres The PostgreSQL ... 402 [OK]
paintedfox/postgresql A docker image ... 50 [OK]
helmi03/docker-postgis PostGIS 2.1 in ... 20 [OK]
atlassianfan/jira Atlassian Jira ... 17 [OK]
orchardup/postgresql https://github ... 16 [OK]
abevoelker/ruby Ruby 2.1.2, Post ... 13 [OK]
slafs/sentry my approach for ... 12 [OK]
...
The command returns over 600 images. The first one is the official Postgres image
maintained by the Postgres team. The other ones are images created by users of
Docker Hub. Some of the images are built and pushed automatically, and you will
learn about automated builds in 
Recipe 2.12
.

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   51   52   53   54   55   56   57   58   ...   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