Docker Cookbook



Download 6,31 Mb.
Pdf ko'rish
bet58/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   54   55   56   57   58   59   60   61   ...   260
Bog'liq
Docker Cookbook

Discussion
This short example uses the default setup of the registry. It assumes no authentica‐
tion, an insecure registry, local storage, and a SQLAlchemy search backend. All of
these can be set via environmental variables or by editing a configuration file. This is
well 
documented
.
The registry that is running via the 
registry
Docker image is a Golang application that
exposes an HTTP REST 
API
, and that you can access with your own registry client or
even 
curl
.
For example, to list all images stored in the private registry, you can use the 
/v2/_cata‐
log
URI:
$ curl http://localhost:5000/v2/_catalog
{"repositories":["busy"]}
If you push another 
busybox
image to the private registry but tagged differently, you
will see it being added to the catalog:
$ docker tag busybox localhost:5000/busy1
$ docker push localhost:5000/busy1
...
$ curl http://localhost:5000/v2/_catalog
{"repositories":["busy","busy1"]}
60 | Chapter 2: Image Creation and Sharing


Each image in the registry is described by a manifest. You can get this manifest via the
API as well at the 
/v2//manifests/
URI, where 

is the name
of the image and 

is a tag of the image:
$ curl http://localhost:5000/v2/busy1/manifests/latest
{
"schemaVersion": 1,
"name": "busy1",
"tag": "latest",
"architecture": "amd64",
"fsLayers": [
{
"blobSum": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d..."
},
{
"blobSum": "sha256:1db09adb5ddd7f1a07b6d585a7db747a51c7bd17418d47e..."
},
{
"blobSum": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d..."
}
],
...
Each 
blob
seen in the preceding code corresponds to a layer of the image. You can
upload, retrieve, and delete blobs through the registry API. Details are available in the
API specification documentation 
page
.
To list all tags for a specific image, use the 
v2//tags/list
URI like so:
$ curl http://localhost:5000/v2/busy1/tags/list
{"name":"busy1","tags":["latest"]}
$ docker tag busybox localhost:5000/busy1:foobar
$ docker push localhost:5000/busy1:foobar
$ curl http://localhost:5000/v2/busy1/tags/list
{"name":"busy1","tags":["foobar","latest"]}
These examples using 
curl
are meant to give you a sense of the registry API. Com‐
plete API documentation is available on the 
Docker website
.
See Also
• The Docker registry page on 
Docker Hub
• The more extensive documentation on 
GitHub
• Deployment 
instructions

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   54   55   56   57   58   59   60   61   ...   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