@@ -152,12 +152,29 @@ public function containerChanges($container)
152152 * @param string $container container ID
153153 * @return Promise Promise<string> tar stream
154154 * @link https://docs.docker.com/reference/api/docker_remote_api_v1.15/#export-a-container
155+ * @see self::containerExportStream()
155156 */
156157 public function containerExport ($ container )
157158 {
158159 return $ this ->browser ->get ($ this ->url ('/containers/%s/export ' , $ container ))->then (array ($ this ->parser , 'expectPlain ' ));
159160 }
160161
162+ /**
163+ * Export the contents of container id
164+ *
165+ * The resulting stream is a well-behaving readable stream that will emit
166+ * the normal stream events.
167+ *
168+ * @param string $container container ID
169+ * @return ReadableStreamInterface tar stream
170+ * @link https://docs.docker.com/reference/api/docker_remote_api_v1.15/#export-a-container
171+ * @see self::containerExport()
172+ */
173+ public function containerExportStream ($ container )
174+ {
175+ return $ this ->streamingParser ->parsePlainStream ($ this ->browser ->get ($ this ->url ('/containers/%s/export ' , $ container )));
176+ }
177+
161178 /**
162179 * Resize the TTY of container id
163180 *
@@ -280,12 +297,31 @@ public function containerRemove($container, $v = false, $force = false)
280297 * @param string $container container ID
281298 * @param array $config resources to copy `array('Resource' => 'file.txt')` (see link)
282299 * @return Promise Promise<string> tar stream
300+ * @link https://docs.docker.com/reference/api/docker_remote_api_v1.15/#copy-files-or-folders-from-a-container
301+ * @see self::containerCopyStream()
283302 */
284303 public function containerCopy ($ container , $ config )
285304 {
286305 return $ this ->postJson ($ this ->url ('/containers/%s/copy ' , $ container ), $ config )->then (array ($ this ->parser , 'expectPlain ' ));
287306 }
288307
308+ /**
309+ * Copy files or folders of container id
310+ *
311+ * The resulting stream is a well-behaving readable stream that will emit
312+ * the normal stream events.
313+ *
314+ * @param string $container container ID
315+ * @param array $config resources to copy `array('Resource' => 'file.txt')` (see link)
316+ * @return ReadableStreamInterface tar stream
317+ * @link https://docs.docker.com/reference/api/docker_remote_api_v1.15/#copy-files-or-folders-from-a-container
318+ * @see self::containerCopy()
319+ */
320+ public function containerCopyStream ($ container , $ config )
321+ {
322+ return $ this ->streamingParser ->parsePlainStream ($ this ->postJson ($ this ->url ('/containers/%s/copy ' , $ container ), $ config ));
323+ }
324+
289325 /**
290326 * List images
291327 *
0 commit comments