@@ -904,16 +904,18 @@ public function imageSearch($term)
904904 * STDOUT/STDERR are multiplexed into separate streams + relatively slow
905905 * This looks strange to you? It probably is. Consider using the first option instead.
906906 *
907- * @param string $container container ID
908- * @param string|array $cmd Command to run specified as an array of strings or a single command string
909- * @param boolean $tty TTY mode
910- * @param boolean $stdin attaches to STDIN of the exec command
911- * @param boolean $stdout attaches to STDOUT of the exec command
912- * @param boolean $stderr attaches to STDERR of the exec command
907+ * @param string $container container ID
908+ * @param string|array $cmd Command to run specified as an array of strings or a single command string
909+ * @param boolean $tty TTY mode
910+ * @param boolean $stdin attaches to STDIN of the exec command
911+ * @param boolean $stdout attaches to STDOUT of the exec command
912+ * @param boolean $stderr attaches to STDERR of the exec command
913+ * @param string|int $user user-specific exec, otherwise defaults to main container user (requires API v1.19+ / Docker v1.7+)
914+ * @param boolean $privileged privileged exec with all capabilities enabled (requires API v1.19+ / Docker v1.7+)
913915 * @return PromiseInterface Promise<array> with exec ID in the form of `array("Id" => $execId)`
914916 * @link https://docs.docker.com/reference/api/docker_remote_api_v1.15/#exec-create
915917 */
916- public function execCreate ($ container , $ cmd , $ tty = false , $ stdin = false , $ stdout = true , $ stderr = true )
918+ public function execCreate ($ container , $ cmd , $ tty = false , $ stdin = false , $ stdout = true , $ stderr = true , $ user = '' , $ privileged = false )
917919 {
918920 if (!is_array ($ cmd )) {
919921 $ cmd = array ('sh ' , '-c ' , (string )$ cmd );
@@ -932,6 +934,8 @@ public function execCreate($container, $cmd, $tty = false, $stdin = false, $stdo
932934 'AttachStdin ' => !!$ stdin ,
933935 'AttachStdout ' => !!$ stdout ,
934936 'AttachStderr ' => !!$ stderr ,
937+ 'User ' => $ user ,
938+ 'Privileged ' => !!$ privileged ,
935939 )
936940 )->then (array ($ this ->parser , 'expectJson ' ));
937941 }
0 commit comments