Docker Cookbook


Exploring the Docker Remote API to Automate Docker



Download 6,31 Mb.
Pdf ko'rish
bet103/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   99   100   101   102   103   104   105   106   ...   260
Bog'liq
Docker Cookbook

4.8 Exploring the Docker Remote API to Automate Docker
Tasks
Problem
After being able to access the Docker daemon remotely (see 
Recipe 4.7
), you want to
explore the Docker remote API in order to write programs. This will allow you to
automate Docker tasks.
Solution
The Docker remote API is fully 
documented
. It is currently on version 1.21. It is a
REST API, in the sense that it manipulates resources (e.g., images and containers)
through HTTP calls using various HTTP methods (e.g., 
GET

POST

DELETE
). The
attach
and 
pull
APIs are not purely REST, as noted in the 
documentation
.
You already saw how to make the Docker daemon listen on a TCP socket (
Recipe 4.7
)
and use 
curl
to make API calls. Tables 
4-1
 and 
4-2
show a summary of the remote
API calls that are available.
Table 4-1. A sample of the API for container actions
Action on containers
HTTP method
URI
List containers
GET
/containers/json
Create container
POST
/containers/create
Inspect a container
GET
/containers/(id)/json
Start a container
POST
/containers/(id)/start
Stop a container
POST
/containers/(id)/stop
Restart a container
POST
/containers/(id)/restart
4.8 Exploring the Docker Remote API to Automate Docker Tasks | 119


Action on containers
HTTP method
URI
Kill a container
POST
/containers/(id)/kill
Pause a container
POST
/containers/(id)/pause
Remove a container
DELETE
/containers/(id)
Table 4-2. A sample of the API for image actions

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   99   100   101   102   103   104   105   106   ...   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