Docker Cookbook


| Chapter 4: Docker Configuration and Development



Download 6,31 Mb.
Pdf ko'rish
bet106/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   102   103   104   105   106   107   108   109   ...   260
Bog'liq
Docker Cookbook

122 | Chapter 4: Docker Configuration and Development


$ export DOCKER_HOST=tcp://test:2376
$ export DOCKER_TLS_VERIFY=1
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
runseb/dockertls latest 5ed60e0f6a7c 19 minutes ago 214.7 MB
You can still use 
curl
as discussed in 
Recipe 4.7
, but you need to specify the client key
and certificate:
$ curl --insecure --cert ~/.docker/cert.pem --key ~/.docker/key.pem \
-s https://test:2376/images/json | python -m json.tool
[
{
"Created": 1419280147,
"Id": "5ed60e0f6a7ce3df3614d20dcadf2e4d43f4054da64d52709c1559ac",
"ParentId": "138f848eb669500df577ca5b7354cef5e65b3c728b0c241221c611b1",
"RepoTags": [
"runseb/dockertls:latest"
],
"Size": 0,
"VirtualSize": 214723529
}
]
Note that you used the 
--insecure curl
option, because you created your own cer‐
tificate authority. By default
curl
will check the certificates against the CAs con‐
tained in the default CA bundle installed on your server. If you were to get server and
client keys and certificates from a trusted CA listed in the default CA bundle, you
would not have to make an 
--insecure
connection. However, this does not mean
that the connection is not properly using TLS.
4.10 Using docker-py to Access the Docker Daemon
Remotely
Problem
Although the Docker client is powerful, you would like to access the Docker daemon
through a Python client. Specifically, you would like to write a Python program that
calls the Docker remote API.
Solution
Import the 
docker-py
Python module from Pip. In a Python script or interactive shell,
create a connection to a remote Docker daemon and start making API calls.

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   102   103   104   105   106   107   108   109   ...   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