-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from dinooo13/commit
Add commit API endpoint
- Loading branch information
Showing
3 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1186,6 +1186,39 @@ public function imageSearch($term) | |
)->then(array($this->parser, 'expectJson')); | ||
} | ||
|
||
/** | ||
* Create a new image from a container | ||
* | ||
* @param ?string $container The ID or name of the container to commit | ||
* @param ?string $repo Repository name for the created image | ||
* @param ?string $tag Tag name for the created image | ||
* @param ?string $comment Commit message | ||
* @param ?string $author Author of the image (e.g., John Hannibal Smith <[email protected]>) | ||
* @param bool $pause Whether to pause the container before committing, default: true | ||
* @param ?string $changes Dockerfile's instructions to apply while committing | ||
* @param array $config The container configuration (body of the request) | ||
* @return PromiseInterface | ||
* @link https://docs.docker.com/engine/api/v1.41/#operation/ImageCommit | ||
*/ | ||
public function containerCommit($container, $repo = null, $tag = null, $comment = null, $author = null, $pause = true, $changes = null, array $config = array()) | ||
{ | ||
return $this->postJson( | ||
$this->uri->expand( | ||
'commit{?container,repo,tag,comment,author,pause,changes}', | ||
array( | ||
'container' => $container, | ||
'repo' => $repo, | ||
'tag' => $tag, | ||
'comment' => $comment, | ||
'author' => $author, | ||
'pause' => $pause, | ||
'changes' => $changes, | ||
) | ||
), | ||
$config | ||
)->then(array($this->parser, 'expectJson')); | ||
} | ||
|
||
/** | ||
* Sets up an exec instance in a running container id | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters