docker_remote_api.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008
  1. =================
  2. Docker Remote API
  3. =================
  4. .. contents:: Table of Contents
  5. 1. Brief introduction
  6. =====================
  7. - The Remote API is replacing rcli
  8. - Default port in the docker deamon is 4243
  9. - The API tends to be REST, but for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout stdin and stderr
  10. 2. Endpoints
  11. ============
  12. 2.1 Containers
  13. --------------
  14. List containers
  15. ***************
  16. .. http:get:: /containers/ps
  17. List containers
  18. **Example request**:
  19. .. sourcecode:: http
  20. GET /containers/ps?all=1&before=8dfafdbc3a40 HTTP/1.1
  21. **Example response**:
  22. .. sourcecode:: http
  23. HTTP/1.1 200 OK
  24. Content-Type: application/json
  25. [
  26. {
  27. "Id": "8dfafdbc3a40",
  28. "Image": "base:latest",
  29. "Command": "echo 1",
  30. "Created": 1367854155,
  31. "Status": "Exit 0"
  32. },
  33. {
  34. "Id": "9cd87474be90",
  35. "Image": "base:latest",
  36. "Command": "echo 222222",
  37. "Created": 1367854155,
  38. "Status": "Exit 0"
  39. },
  40. {
  41. "Id": "3176a2479c92",
  42. "Image": "base:latest",
  43. "Command": "echo 3333333333333333",
  44. "Created": 1367854154,
  45. "Status": "Exit 0"
  46. },
  47. {
  48. "Id": "4cb07b47f9fb",
  49. "Image": "base:latest",
  50. "Command": "echo 444444444444444444444444444444444",
  51. "Created": 1367854152,
  52. "Status": "Exit 0"
  53. }
  54. ]
  55. :query all: 1/True/true or 0/False/false, Show all containers. Only running containers are shown by default
  56. :query limit: Show ``limit`` last created containers, include non-running ones.
  57. :query since: Show only containers created since Id, include non-running ones.
  58. :query before: Show only containers created before Id, include non-running ones.
  59. :statuscode 200: no error
  60. :statuscode 400: bad parameter
  61. :statuscode 500: server error
  62. Create a container
  63. ******************
  64. .. http:post:: /containers/create
  65. Create a container
  66. **Example request**:
  67. .. sourcecode:: http
  68. POST /containers/create HTTP/1.1
  69. Content-Type: application/json
  70. {
  71. "Hostname":"",
  72. "User":"",
  73. "Memory":0,
  74. "MemorySwap":0,
  75. "AttachStdin":false,
  76. "AttachStdout":true,
  77. "AttachStderr":true,
  78. "PortSpecs":null,
  79. "Tty":false,
  80. "OpenStdin":false,
  81. "StdinOnce":false,
  82. "Env":null,
  83. "Cmd":[
  84. "date"
  85. ],
  86. "Dns":null,
  87. "Image":"base",
  88. "Volumes":{},
  89. "VolumesFrom":""
  90. }
  91. **Example response**:
  92. .. sourcecode:: http
  93. HTTP/1.1 201 OK
  94. Content-Type: application/json
  95. {
  96. "Id":"e90e34656806"
  97. "Warnings":[]
  98. }
  99. :jsonparam config: the container's configuration
  100. :statuscode 201: no error
  101. :statuscode 404: no such container
  102. :statuscode 500: server error
  103. Inspect a container
  104. *******************
  105. .. http:get:: /containers/(id)/json
  106. Return low-level information on the container ``id``
  107. **Example request**:
  108. .. sourcecode:: http
  109. GET /containers/4fa6e0f0c678/json HTTP/1.1
  110. **Example response**:
  111. .. sourcecode:: http
  112. HTTP/1.1 200 OK
  113. Content-Type: application/json
  114. {
  115. "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2",
  116. "Created": "2013-05-07T14:51:42.041847+02:00",
  117. "Path": "date",
  118. "Args": [],
  119. "Config": {
  120. "Hostname": "4fa6e0f0c678",
  121. "User": "",
  122. "Memory": 0,
  123. "MemorySwap": 0,
  124. "AttachStdin": false,
  125. "AttachStdout": true,
  126. "AttachStderr": true,
  127. "PortSpecs": null,
  128. "Tty": false,
  129. "OpenStdin": false,
  130. "StdinOnce": false,
  131. "Env": null,
  132. "Cmd": [
  133. "date"
  134. ],
  135. "Dns": null,
  136. "Image": "base",
  137. "Volumes": {},
  138. "VolumesFrom": ""
  139. },
  140. "State": {
  141. "Running": false,
  142. "Pid": 0,
  143. "ExitCode": 0,
  144. "StartedAt": "2013-05-07T14:51:42.087658+02:01360",
  145. "Ghost": false
  146. },
  147. "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
  148. "NetworkSettings": {
  149. "IpAddress": "",
  150. "IpPrefixLen": 0,
  151. "Gateway": "",
  152. "Bridge": "",
  153. "PortMapping": null
  154. },
  155. "SysInitPath": "/home/kitty/go/src/github.com/dotcloud/docker/bin/docker",
  156. "ResolvConfPath": "/etc/resolv.conf",
  157. "Volumes": {}
  158. }
  159. :statuscode 200: no error
  160. :statuscode 404: no such container
  161. :statuscode 500: server error
  162. Inspect changes on a container's filesystem
  163. *******************************************
  164. .. http:get:: /containers/(id)/changes
  165. Inspect changes on container ``id`` 's filesystem
  166. **Example request**:
  167. .. sourcecode:: http
  168. GET /containers/4fa6e0f0c678/changes HTTP/1.1
  169. **Example response**:
  170. .. sourcecode:: http
  171. HTTP/1.1 200 OK
  172. Content-Type: application/json
  173. [
  174. {
  175. "Path":"/dev",
  176. "Kind":0
  177. },
  178. {
  179. "Path":"/dev/kmsg",
  180. "Kind":1
  181. },
  182. {
  183. "Path":"/test",
  184. "Kind":1
  185. }
  186. ]
  187. :statuscode 200: no error
  188. :statuscode 404: no such container
  189. :statuscode 500: server error
  190. Export a container
  191. ******************
  192. .. http:get:: /containers/(id)/export
  193. Export the contents of container ``id``
  194. **Example request**:
  195. .. sourcecode:: http
  196. GET /containers/4fa6e0f0c678/export HTTP/1.1
  197. **Example response**:
  198. .. sourcecode:: http
  199. HTTP/1.1 200 OK
  200. Content-Type: application/octet-stream
  201. {{ STREAM }}
  202. :statuscode 200: no error
  203. :statuscode 404: no such container
  204. :statuscode 500: server error
  205. Start a container
  206. *****************
  207. .. http:post:: /containers/(id)/start
  208. Start the container ``id``
  209. **Example request**:
  210. .. sourcecode:: http
  211. POST /containers/e90e34656806/start HTTP/1.1
  212. **Example response**:
  213. .. sourcecode:: http
  214. HTTP/1.1 200 OK
  215. :statuscode 200: no error
  216. :statuscode 404: no such container
  217. :statuscode 500: server error
  218. Stop a contaier
  219. ***************
  220. .. http:post:: /containers/(id)/stop
  221. Stop the container ``id``
  222. **Example request**:
  223. .. sourcecode:: http
  224. POST /containers/e90e34656806/stop?t=5 HTTP/1.1
  225. **Example response**:
  226. .. sourcecode:: http
  227. HTTP/1.1 204 OK
  228. :query t: number of seconds to wait before killing the container
  229. :statuscode 204: no error
  230. :statuscode 404: no such container
  231. :statuscode 500: server error
  232. Restart a container
  233. *******************
  234. .. http:post:: /containers/(id)/restart
  235. Restart the container ``id``
  236. **Example request**:
  237. .. sourcecode:: http
  238. POST /containers/e90e34656806/restart?t=5 HTTP/1.1
  239. **Example response**:
  240. .. sourcecode:: http
  241. HTTP/1.1 204 OK
  242. :query t: number of seconds to wait before killing the container
  243. :statuscode 204: no error
  244. :statuscode 404: no such container
  245. :statuscode 500: server error
  246. Kill a container
  247. ****************
  248. .. http:post:: /containers/(id)/kill
  249. Kill the container ``id``
  250. **Example request**:
  251. .. sourcecode:: http
  252. POST /containers/e90e34656806/kill HTTP/1.1
  253. **Example response**:
  254. .. sourcecode:: http
  255. HTTP/1.1 204 OK
  256. :statuscode 204: no error
  257. :statuscode 404: no such container
  258. :statuscode 500: server error
  259. Attach to a container
  260. *********************
  261. .. http:post:: /containers/(id)/attach
  262. Stop the container ``id``
  263. **Example request**:
  264. .. sourcecode:: http
  265. POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1
  266. **Example response**:
  267. .. sourcecode:: http
  268. HTTP/1.1 200 OK
  269. Content-Type: application/vnd.docker.raw-stream
  270. {{ STREAM }}
  271. :query logs: 1/True/true or 0/False/false, return logs. Default false
  272. :query stream: 1/True/true or 0/False/false, return stream. Default false
  273. :query stdin: 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false
  274. :query stdout: 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false
  275. :query stderr: 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false
  276. :statuscode 200: no error
  277. :statuscode 400: bad parameter
  278. :statuscode 404: no such container
  279. :statuscode 500: server error
  280. Wait a container
  281. ****************
  282. .. http:post:: /containers/(id)/wait
  283. Block until container ``id`` stops, then returns the exit code
  284. **Example request**:
  285. .. sourcecode:: http
  286. POST /containers/16253994b7c4/wait HTTP/1.1
  287. **Example response**:
  288. .. sourcecode:: http
  289. HTTP/1.1 200 OK
  290. Content-Type: application/json
  291. {"StatusCode":0}
  292. :statuscode 200: no error
  293. :statuscode 404: no such container
  294. :statuscode 500: server error
  295. Remove a container
  296. *******************
  297. .. http:delete:: /containers/(id)
  298. Remove the container ``id`` from the filesystem
  299. **Example request**:
  300. .. sourcecode:: http
  301. DELETE /containers/16253994b7c4?v=1 HTTP/1.1
  302. **Example response**:
  303. .. sourcecode:: http
  304. HTTP/1.1 204 OK
  305. :query v: 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false
  306. :statuscode 204: no error
  307. :statuscode 400: bad parameter
  308. :statuscode 404: no such container
  309. :statuscode 500: server error
  310. 2.2 Images
  311. ----------
  312. List Images
  313. ***********
  314. .. http:get:: /images/(format)
  315. List images ``format`` could be json or viz (json default)
  316. **Example request**:
  317. .. sourcecode:: http
  318. GET /images/json?all=0 HTTP/1.1
  319. **Example response**:
  320. .. sourcecode:: http
  321. HTTP/1.1 200 OK
  322. Content-Type: application/json
  323. [
  324. {
  325. "Repository":"base",
  326. "Tag":"ubuntu-12.10",
  327. "Id":"b750fe79269d",
  328. "Created":1364102658
  329. },
  330. {
  331. "Repository":"base",
  332. "Tag":"ubuntu-quantal",
  333. "Id":"b750fe79269d",
  334. "Created":1364102658
  335. }
  336. ]
  337. **Example request**:
  338. .. sourcecode:: http
  339. GET /images/viz HTTP/1.1
  340. **Example response**:
  341. .. sourcecode:: http
  342. HTTP/1.1 200 OK
  343. Content-Type: text/plain
  344. digraph docker {
  345. "d82cbacda43a" -> "074be284591f"
  346. "1496068ca813" -> "08306dc45919"
  347. "08306dc45919" -> "0e7893146ac2"
  348. "b750fe79269d" -> "1496068ca813"
  349. base -> "27cf78414709" [style=invis]
  350. "f71189fff3de" -> "9a33b36209ed"
  351. "27cf78414709" -> "b750fe79269d"
  352. "0e7893146ac2" -> "d6434d954665"
  353. "d6434d954665" -> "d82cbacda43a"
  354. base -> "e9aa60c60128" [style=invis]
  355. "074be284591f" -> "f71189fff3de"
  356. "b750fe79269d" [label="b750fe79269d\nbase",shape=box,fillcolor="paleturquoise",style="filled,rounded"];
  357. "e9aa60c60128" [label="e9aa60c60128\nbase2",shape=box,fillcolor="paleturquoise",style="filled,rounded"];
  358. "9a33b36209ed" [label="9a33b36209ed\ntest",shape=box,fillcolor="paleturquoise",style="filled,rounded"];
  359. base [style=invisible]
  360. }
  361. :query all: 1/True/true or 0/False/false, Show all containers. Only running containers are shown by default
  362. :statuscode 200: no error
  363. :statuscode 400: bad parameter
  364. :statuscode 500: server error
  365. Create an image
  366. ***************
  367. .. http:post:: /images/create
  368. Create an image, either by pull it from the registry or by importing it
  369. **Example request**:
  370. .. sourcecode:: http
  371. POST /images/create?fromImage=base HTTP/1.1
  372. **Example response**:
  373. .. sourcecode:: http
  374. HTTP/1.1 200 OK
  375. Content-Type: application/vnd.docker.raw-stream
  376. {{ STREAM }}
  377. :query fromImage: name of the image to pull
  378. :query fromSrc: source to import, - means stdin
  379. :query repo: repository
  380. :query tag: tag
  381. :query registry: the registry to pull from
  382. :statuscode 200: no error
  383. :statuscode 500: server error
  384. Insert a file in a image
  385. ************************
  386. .. http:post:: /images/(name)/insert
  387. Insert a file from ``url`` in the image ``name`` at ``path``
  388. **Example request**:
  389. .. sourcecode:: http
  390. POST /images/test/insert?path=/usr&url=myurl HTTP/1.1
  391. **Example response**:
  392. .. sourcecode:: http
  393. HTTP/1.1 200 OK
  394. {{ STREAM }}
  395. :statuscode 200: no error
  396. :statuscode 500: server error
  397. Inspect an image
  398. ****************
  399. .. http:get:: /images/(name)/json
  400. Return low-level information on the image ``name``
  401. **Example request**:
  402. .. sourcecode:: http
  403. GET /images/base/json HTTP/1.1
  404. **Example response**:
  405. .. sourcecode:: http
  406. HTTP/1.1 200 OK
  407. Content-Type: application/json
  408. {
  409. "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
  410. "parent":"27cf784147099545",
  411. "created":"2013-03-23T22:24:18.818426-07:00",
  412. "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0",
  413. "container_config":
  414. {
  415. "Hostname":"",
  416. "User":"",
  417. "Memory":0,
  418. "MemorySwap":0,
  419. "AttachStdin":false,
  420. "AttachStdout":false,
  421. "AttachStderr":false,
  422. "PortSpecs":null,
  423. "Tty":true,
  424. "OpenStdin":true,
  425. "StdinOnce":false,
  426. "Env":null,
  427. "Cmd": ["/bin/bash"]
  428. ,"Dns":null,
  429. "Image":"base",
  430. "Volumes":null,
  431. "VolumesFrom":""
  432. }
  433. }
  434. :statuscode 200: no error
  435. :statuscode 404: no such image
  436. :statuscode 500: server error
  437. Get the history of an image
  438. ***************************
  439. .. http:get:: /images/(name)/history
  440. Return the history of the image ``name``
  441. **Example request**:
  442. .. sourcecode:: http
  443. GET /images/base/history HTTP/1.1
  444. **Example response**:
  445. .. sourcecode:: http
  446. HTTP/1.1 200 OK
  447. Content-Type: application/json
  448. [
  449. {
  450. "Id":"b750fe79269d",
  451. "Created":1364102658,
  452. "CreatedBy":"/bin/bash"
  453. },
  454. {
  455. "Id":"27cf78414709",
  456. "Created":1364068391,
  457. "CreatedBy":""
  458. }
  459. ]
  460. :statuscode 200: no error
  461. :statuscode 404: no such image
  462. :statuscode 500: server error
  463. Push an image on the registry
  464. *****************************
  465. .. http:post:: /images/(name)/push
  466. Push the image ``name`` on the registry
  467. **Example request**:
  468. .. sourcecode:: http
  469. POST /images/test/push HTTP/1.1
  470. **Example response**:
  471. .. sourcecode:: http
  472. HTTP/1.1 200 OK
  473. Content-Type: application/vnd.docker.raw-stream
  474. {{ STREAM }}
  475. :query registry: the registry you wan to push, optional
  476. :statuscode 200: no error
  477. :statuscode 404: no such image
  478. :statuscode 500: server error
  479. Tag an image into a repository
  480. ******************************
  481. .. http:post:: /images/(name)/tag
  482. Tag the image ``name`` into a repository
  483. **Example request**:
  484. .. sourcecode:: http
  485. POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1
  486. **Example response**:
  487. .. sourcecode:: http
  488. HTTP/1.1 200 OK
  489. :query repo: The repository to tag in
  490. :query force: 1/True/true or 0/False/false, default false
  491. :statuscode 200: no error
  492. :statuscode 400: bad parameter
  493. :statuscode 404: no such image
  494. :statuscode 500: server error
  495. Remove an image
  496. ***************
  497. .. http:delete:: /images/(name)
  498. Remove the image ``name`` from the filesystem
  499. **Example request**:
  500. .. sourcecode:: http
  501. DELETE /images/test HTTP/1.1
  502. **Example response**:
  503. .. sourcecode:: http
  504. HTTP/1.1 204 OK
  505. :statuscode 204: no error
  506. :statuscode 404: no such image
  507. :statuscode 500: server error
  508. Search images
  509. *************
  510. .. http:get:: /images/search
  511. Search for an image in the docker index
  512. **Example request**:
  513. .. sourcecode:: http
  514. GET /images/search?term=sshd HTTP/1.1
  515. **Example response**:
  516. .. sourcecode:: http
  517. HTTP/1.1 200 OK
  518. Content-Type: application/json
  519. [
  520. {
  521. "Name":"cespare/sshd",
  522. "Description":""
  523. },
  524. {
  525. "Name":"johnfuller/sshd",
  526. "Description":""
  527. },
  528. {
  529. "Name":"dhrp/mongodb-sshd",
  530. "Description":""
  531. }
  532. ]
  533. :query term: term to search
  534. :statuscode 200: no error
  535. :statuscode 500: server error
  536. 2.3 Misc
  537. --------
  538. Build an image from Dockerfile via stdin
  539. ****************************************
  540. .. http:post:: /build
  541. Build an image from Dockerfile via stdin
  542. **Example request**:
  543. .. sourcecode:: http
  544. POST /build HTTP/1.1
  545. {{ STREAM }}
  546. **Example response**:
  547. .. sourcecode:: http
  548. HTTP/1.1 200 OK
  549. {{ STREAM }}
  550. :statuscode 200: no error
  551. :statuscode 500: server error
  552. Get default username and email
  553. ******************************
  554. .. http:get:: /auth
  555. Get the default username and email
  556. **Example request**:
  557. .. sourcecode:: http
  558. GET /auth HTTP/1.1
  559. **Example response**:
  560. .. sourcecode:: http
  561. HTTP/1.1 200 OK
  562. Content-Type: application/json
  563. {
  564. "username":"hannibal",
  565. "email":"hannibal@a-team.com"
  566. }
  567. :statuscode 200: no error
  568. :statuscode 500: server error
  569. Set auth configuration
  570. **********************
  571. .. http:post:: /auth
  572. Get the default username and email
  573. **Example request**:
  574. .. sourcecode:: http
  575. POST /auth HTTP/1.1
  576. Content-Type: application/json
  577. {
  578. "username":"hannibal",
  579. "password:"xxxx",
  580. "email":"hannibal@a-team.com"
  581. }
  582. **Example response**:
  583. .. sourcecode:: http
  584. HTTP/1.1 200 OK
  585. :statuscode 200: no error
  586. :statuscode 204: no error
  587. :statuscode 500: server error
  588. Display system-wide information
  589. *******************************
  590. .. http:get:: /info
  591. Display system-wide information
  592. **Example request**:
  593. .. sourcecode:: http
  594. GET /info HTTP/1.1
  595. **Example response**:
  596. .. sourcecode:: http
  597. HTTP/1.1 200 OK
  598. Content-Type: application/json
  599. {
  600. "Containers":11,
  601. "Version":"0.2.2",
  602. "Images":16,
  603. "GoVersion":"go1.0.3",
  604. "Debug":false
  605. }
  606. :statuscode 200: no error
  607. :statuscode 500: server error
  608. Show the docker version information
  609. ***********************************
  610. .. http:get:: /version
  611. Show the docker version information
  612. **Example request**:
  613. .. sourcecode:: http
  614. GET /version HTTP/1.1
  615. **Example response**:
  616. .. sourcecode:: http
  617. HTTP/1.1 200 OK
  618. Content-Type: application/json
  619. {
  620. "Version":"0.2.2",
  621. "GitCommit":"5a2a5cc+CHANGES",
  622. "MemoryLimit":true,
  623. "SwapLimit":false
  624. }
  625. :statuscode 200: no error
  626. :statuscode 500: server error
  627. Create a new image from a container's changes
  628. *********************************************
  629. .. http:post:: /commit
  630. Create a new image from a container's changes
  631. **Example request**:
  632. .. sourcecode:: http
  633. POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
  634. **Example response**:
  635. .. sourcecode:: http
  636. HTTP/1.1 201 OK
  637. Content-Type: application/vnd.docker.raw-stream
  638. {"Id":"596069db4bf5"}
  639. :query container: source container
  640. :query repo: repository
  641. :query tag: tag
  642. :query m: commit message
  643. :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
  644. :query run: config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
  645. :statuscode 201: no error
  646. :statuscode 404: no such container
  647. :statuscode 500: server error
  648. 3. Going further
  649. ================
  650. 3.1 Inside 'docker run'
  651. -----------------------
  652. Here are the steps of 'docker run' :
  653. * Create the container
  654. * If the status code is 404, it means the image doesn't exists:
  655. * Try to pull it
  656. * Then retry to create the container
  657. * Start the container
  658. * If you are not in detached mode:
  659. * Attach to the container, using logs=1 (to have stdout and stderr from the container's start) and stream=1
  660. * If in detached mode or only stdin is attached:
  661. * Display the container's id
  662. 3.2 Hijacking
  663. -------------
  664. In this first version of the API, some of the endpoints, like /attach, /pull or /push uses hijacking to transport stdin,
  665. stdout and stderr on the same socket. This might change in the future.