'Commit a container to an image. Similar to the ``docker commit``
command.
Args:
container (str): The image hash of the container
repository (str): The repository to push the image to
tag (str): The tag to push
message (str): A commit message
author (str): The name of the author
changes (str): Dockerfile instructions to apply while committing
conf (dict): The configuration for the container. See the
`Engine API documentation
<https://docs.docker.com/reference/api/docker_remote_api/>`_
for full details.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.'

@utils.check_resource('container')
def commit(self, container, repository=None, tag=None, message=None, author=None, changes=None, conf=None):

    params = {'container': container, 'repo': repository, 'tag': tag, 'comment': message, 'author': author, 'changes': changes}
    u = self._url('/commit')
    return self._result(self._post_json(u, data=conf, params=params), json=True)
