Docker Cookbook


See Also • Understanding the  ONBUILD   directive • ONBUILD reference 2.11 Running a Private Registry



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

See Also
• Understanding the 
ONBUILD
 
directive

ONBUILD
reference
2.11 Running a Private Registry
Problem
Using the public Docker Hub is easy. However, you might have data governance con‐
cerns with your images being hosted outside your own infrastructure. Therefore, you
would like to run your own Docker registry, hosting it on your own infrastructure.
Solution
Use the Docker registry 
image
and start a container from it. You will have your pri‐
vate registry.
Pull the official 
registry
image and run it as a detached container. You should then be
able to 
curl
 
http://localhost:5000/v2
for a quick test that the registry is running:
$ docker pull registry:2
$ docker run -d -p 5000:5000 registry:2
$ curl -i http://localhost:5000/v2/
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json; charset=utf-8
Docker-Distribution-Api-Version: registry/2.0
Date: Wed, 19 Aug 2015 23:07:47 GMT
The preceding reponse shows that you are running the Docker registry with API ver‐
sion v2. You can now prepare a local image that you have created previously (e.g., a
flask
 image, 
Recipe 2.4
) and tag it with the proper naming convention for use with a
private registry. In our case, the registry is running at 
http://localhost:5000
, so we will
2.11 Running a Private Registry | 59


prefix our tag with 
localhost:5000
and then push this image to the private registry.
You can also use the IP address of your Docker host:
$ docker tag busybox localhost:5000/busy
$ docker push localhost:5000/busy
The push refers to a repository [localhost:5000/busy] (len: 1)
8c2e06607696: Image successfully pushed
6ce2e90b0bc7: Image successfully pushed
cf2616975b4a: Image already exists
latest: digest: sha256:3b5b980...a4d59f24f9c7253fce29 size: 5049
If you try to access this private registry from another machine, you will get an error
message telling you that your Docker client does not allow you to use an insecure reg‐
istry. For testing purposes only, edit your Docker configuration file to use the
insecure-registry
option. For instance, on Ubuntu 14.04, edit 
/etc/default/docker
and add this line:
DOCKER_OPTS="--insecure-registry :5000"
Then restart Docker on your machine (
sudo service docker restart
) and try to
access the remote private registry again. (Remember that this is done on a different
machine than where you are running the registry.)

Download 6,31 Mb.

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