diff --git a/CHANGELOG b/CHANGELOG
index 2d7da75..238dbfc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,10 @@
-0.2.0 (2016-08-28)
+0.3.0 (in development)
 ----------------------
+* Add container_upload() method.
+* Add commit() method.
+
+0.2.0 (2016-08-28)
+------------------
 * Add container_remove() method.
 * Add container_start() method.
 * Add container_wait() method.
diff --git a/xd/docker/client.py b/xd/docker/client.py
index 879dea2..f16bc78 100644
--- a/xd/docker/client.py
+++ b/xd/docker/client.py
@@ -643,3 +643,40 @@ class DockerClient(object):
                 raise PermissionDenied(
                     "Volume or container rootfs is marked as read-only") \
                     from exc
+
+    def commit(self,
+               container: Union[Container, ContainerName, str],
+               repo: Optional[Union[Repository, str]]=None,
+               comment: Optional[str]=None,
+               author: Optional[str]=None,
+               pause: Optional[bool]=None):
+
+        # Handle convenience argument types
+        if isinstance(container, str):
+            id_or_name = container
+        elif isinstance(container, ContainerName):
+            id_or_name = container.name
+        else:
+            id_or_name = container.id or container.name
+        if isinstance(repo, str):
+            repo = Repository(repo)
+
+        params = {'container': id_or_name}
+        if repo:
+            params['repo'] = repo.name
+            if repo.tag is not None:
+                params['tag'] = repo.tag
+        if comment is not None:
+            params['comment'] = comment
+        if author is not None:
+            params['author'] = author
+        if pause is not None:
+            params['pause'] = pause
+
+        # TODO: add support for 'config' JSON parameter
+        # The ContainerConfig class should be changed to allow image to be
+        # optional, so we can simply pass a instance of that
+
+        # TODO: add support for 'changes' query parameter
+        r = self._post('/commit', params=params)
+        return Image(self, id=r.json()['Id'])

client.commit()
Client API command to create an image from a container.
diff --git a/tests/integration/commit_test.py b/tests/integration/commit_test.py
new file mode 100644
index 0000000..b2009b1
--- /dev/null
+++ b/tests/integration/commit_test.py
@@ -0,0 +1,57 @@
+import pytest
+import os
+import re
+import json
+
+
+from xd.docker.client import *
+
+
+def test_basic(docker, stdout):
+    os.system("docker create --name xd-docker-test busybox:latest")
+    foo = docker.commit('xd-docker-test')
+    assert foo.id
+    assert os.system('docker inspect {}'.format(foo.id) +
+                     '|grep \'"Comment": "foobar"\'') != 0
+    assert os.system('docker inspect {}'.format(foo.id) +
+                     '|grep \'"Author": "foobar"\'') != 0
+
+
+def test_with_repo(docker, stdout):
+    os.system("docker create --name xd-docker-test busybox:latest")
+    foo = docker.commit('xd-docker-test', repo='foo')
+    assert foo.id
+
+
+def test_with_tag(docker, stdout):
+    os.system("docker create --name xd-docker-test busybox:latest")
+    foo = docker.commit('xd-docker-test', repo='foo:bar')
+    assert foo.id
+
+
+def test_comment(docker, stdout):
+    os.system("docker create --name xd-docker-test busybox:latest")
+    foo = docker.commit('xd-docker-test', comment='foobar')
+    assert foo.id
+    assert os.system('docker inspect {}'.format(foo.id) +
+                     '|grep \'"Comment": "foobar"\'') == 0
+
+
+def test_author(docker, stdout):
+    os.system("docker create --name xd-docker-test busybox:latest")
+    foo = docker.commit('xd-docker-test', author='foobar')
+    assert foo.id
+    assert os.system('docker inspect {}'.format(foo.id) +
+                     '|grep \'"Author": "foobar"\'') == 0
+
+
+def test_pause_true(docker, stdout):
+    os.system("docker create --name xd-docker-test busybox:latest")
+    foo = docker.commit('xd-docker-test', pause=True)
+    assert foo.id
+
+
+def test_pause_false(docker, stdout):
+    os.system("docker create --name xd-docker-test busybox:latest")
+    foo = docker.commit('xd-docker-test', pause=False)
+    assert foo.id
diff --git a/tests/unit/client_test.py b/tests/unit/client_test.py
index 4e7fbb6..aef1579 100644
--- a/tests/unit/client_test.py
+++ b/tests/unit/client_test.py
@@ -1450,3 +1450,86 @@ class container_upload_tests(ContextClientTestCase):
             return_value=requests_mock.version_response("1.19", "1.7.1"))
         with pytest.raises(IncompatibleRemoteAPI):
             self.client.container_upload('foo', self.tar_file, 'bar')
+
+
+class commit_tests(ContextClientTestCase):
+
+    @mock.patch('requests.post')
+    def test_str(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit('foo')
+
+    @mock.patch('requests.post')
+    def test_containername(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit(ContainerName('foo'))
+
+    @mock.patch('requests.post')
+    def test_container(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit(Container('foo'))
+
+    @mock.patch('requests.post')
+    def test_repo_str(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit('foobar', repo='foo')
+        assert 'params' in post_mock.call_args[1]
+        params = post_mock.call_args[1]['params']
+        assert 'repo' in params
+        assert params['repo'] == 'foo'
+
+    @mock.patch('requests.post')
+    def test_repotag_str(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit('foobar', repo='foo:bar')
+        assert 'params' in post_mock.call_args[1]
+        params = post_mock.call_args[1]['params']
+        assert 'repo' in params
+        assert params['repo'] == 'foo'
+        assert 'tag' in params
+        assert params['tag'] == 'bar'
+
+    @mock.patch('requests.post')
+    def test_comment(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit('foobar', comment='foo')
+        assert 'params' in post_mock.call_args[1]
+        params = post_mock.call_args[1]['params']
+        assert 'comment' in params
+        assert params['comment'] == 'foo'
+
+    @mock.patch('requests.post')
+    def test_author(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit('foobar', author='foo')
+        assert 'params' in post_mock.call_args[1]
+        params = post_mock.call_args[1]['params']
+        assert 'author' in params
+        assert params['author'] == 'foo'
+
+    @mock.patch('requests.post')
+    def test_pause_true(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit('foo', pause=True)
+        assert 'params' in post_mock.call_args[1]
+        params = post_mock.call_args[1]['params']
+        assert 'pause' in params
+        assert params['pause'] == True
+
+    @mock.patch('requests.post')
+    def test_pause_false(self, post_mock):
+        post_mock.return_value = requests_mock.Response(
+            '{"Id": "596069db4bf5"}', 201)
+        self.client.commit('foo', pause=False)
+        assert 'params' in post_mock.call_args[1]
+        params = post_mock.call_args[1]['params']
+        assert 'pause' in params
+        assert params['pause'] == False

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov mock flake8
apt-get update apt-get install -y gcc
3.5
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
flake8==5.0.4
idna==3.10
importlib-metadata==4.2.0
iniconfig==1.1.1
mccabe==0.7.0
mock==5.2.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
requests==2.27.1
requests-unixsocket==0.3.0
tomli==1.2.3
typing==3.7.4.3
typing_extensions==4.1.1
urllib3==1.26.20
-e git+https://github.com/XD-embedded/xd-docker.git@2b82bcc8ca4ebdcfdc719865c4910de092052be1#egg=XD_Docker
zipp==3.6.0

name: xd-docker
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - flake8==5.0.4
      - idna==3.10
      - importlib-metadata==4.2.0
      - iniconfig==1.1.1
      - mccabe==0.7.0
      - mock==5.2.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - requests==2.27.1
      - requests-unixsocket==0.3.0
      - tomli==1.2.3
      - typing==3.7.4.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/xd-docker

tests/unit/client_test.py::commit_tests::test_author tests/unit/client_test.py::commit_tests::test_comment tests/unit/client_test.py::commit_tests::test_container tests/unit/client_test.py::commit_tests::test_containername tests/unit/client_test.py::commit_tests::test_pause_false tests/unit/client_test.py::commit_tests::test_pause_true tests/unit/client_test.py::commit_tests::test_repo_str tests/unit/client_test.py::commit_tests::test_repotag_str tests/unit/client_test.py::commit_tests::test_str
tests/integration/commit_test.py::test_basic tests/integration/commit_test.py::test_with_repo tests/integration/commit_test.py::test_with_tag tests/integration/commit_test.py::test_comment tests/integration/commit_test.py::test_author tests/integration/commit_test.py::test_pause_true tests/integration/commit_test.py::test_pause_false
tests/unit/client_test.py::init_tests::test_init_foobar tests/unit/client_test.py::init_tests::test_init_http tests/unit/client_test.py::init_tests::test_init_http_unix tests/unit/client_test.py::init_tests::test_init_noargs tests/unit/client_test.py::init_tests::test_init_tcp tests/unit/client_test.py::init_tests::test_init_unix tests/unit/client_test.py::version_tests::test_version tests/unit/client_test.py::version_tests::test_version_httperror_404 tests/unit/client_test.py::version_tests::test_version_httperror_500 tests/unit/client_test.py::version_tests::test_version_httperror_unknown tests/unit/client_test.py::ping_tests::test_ping tests/unit/client_test.py::ping_tests::test_ping_server_error tests/unit/client_test.py::containers_tests::test_containers_1 tests/unit/client_test.py::containers_tests::test_containers_3 tests/unit/client_test.py::containers_tests::test_containers_4 tests/unit/client_test.py::containers_tests::test_containers_only_running_false tests/unit/client_test.py::images_tests::test_images tests/unit/client_test.py::image_inspect_tests::test_image_inspect tests/unit/client_test.py::image_inspect_tests::test_image_inspect_raw tests/unit/client_test.py::image_build_tests::test_image_build tests/unit/client_test.py::image_build_tests::test_image_build_context_as_file tests/unit/client_test.py::image_build_tests::test_image_build_context_does_not_exist tests/unit/client_test.py::image_build_tests::test_image_build_invalid_pull tests/unit/client_test.py::image_build_tests::test_image_build_invalid_rm tests/unit/client_test.py::image_build_tests::test_image_build_invalid_tag_1 tests/unit/client_test.py::image_build_tests::test_image_build_invalid_tag_2 tests/unit/client_test.py::image_build_tests::test_image_build_nonstandard_dockerfile tests/unit/client_test.py::image_build_tests::test_image_build_run_error tests/unit/client_test.py::image_build_tests::test_image_build_server_error tests/unit/client_test.py::image_build_tests::test_image_build_with_args tests/unit/client_test.py::image_build_tests::test_image_build_with_forcerm tests/unit/client_test.py::image_build_tests::test_image_build_with_name tests/unit/client_test.py::image_build_tests::test_image_build_with_nocache tests/unit/client_test.py::image_build_tests::test_image_build_with_norm tests/unit/client_test.py::image_build_tests::test_image_build_with_only_error_output tests/unit/client_test.py::image_build_tests::test_image_build_with_pull tests/unit/client_test.py::image_build_tests::test_image_build_with_registry_config tests/unit/client_test.py::image_pull_tests::test_image_pull_1_ok tests/unit/client_test.py::image_pull_tests::test_image_pull_2_not_found tests/unit/client_test.py::image_pull_tests::test_image_pull_3_authconfig tests/unit/client_test.py::image_pull_tests::test_image_pull_4_invalid_authconfig tests/unit/client_test.py::image_remove_tests::test_image_remove_1 tests/unit/client_test.py::image_remove_tests::test_image_remove_2_not_found tests/unit/client_test.py::image_tag_tests::test_image_tag_1_repo tests/unit/client_test.py::image_tag_tests::test_image_tag_2_repo_and_tag tests/unit/client_test.py::image_tag_tests::test_image_tag_3_force tests/unit/client_test.py::image_tag_tests::test_image_tag_4_fail tests/unit/client_test.py::container_create_tests::test_container_create_1_anon tests/unit/client_test.py::container_create_tests::test_container_create_2_named tests/unit/client_test.py::container_create_tests::test_container_create_3_named_str tests/unit/client_test.py::container_create_tests::test_container_create_nopull_needed tests/unit/client_test.py::container_create_tests::test_container_create_nopull_not_needed tests/unit/client_test.py::container_create_tests::test_container_create_pull_needed tests/unit/client_test.py::container_create_tests::test_container_create_pull_not_needed tests/unit/client_test.py::container_create_tests::test_container_create_with_command tests/unit/client_test.py::container_create_tests::test_container_create_with_env tests/unit/client_test.py::container_create_tests::test_container_create_with_exposed_ports tests/unit/client_test.py::container_create_tests::test_container_create_with_memory tests/unit/client_test.py::container_create_tests::test_container_create_with_memory_and_swap tests/unit/client_test.py::container_create_tests::test_container_create_with_network_false tests/unit/client_test.py::container_create_tests::test_container_create_with_oom_kill_false tests/unit/client_test.py::container_create_tests::test_container_create_with_swap_but_not_memory tests/unit/client_test.py::container_remove_tests::test_container_with_id tests/unit/client_test.py::container_remove_tests::test_container_with_id_and_name tests/unit/client_test.py::container_remove_tests::test_container_with_name tests/unit/client_test.py::container_remove_tests::test_containername tests/unit/client_test.py::container_remove_tests::test_force_false tests/unit/client_test.py::container_remove_tests::test_force_true tests/unit/client_test.py::container_remove_tests::test_no_such_container tests/unit/client_test.py::container_remove_tests::test_ok tests/unit/client_test.py::container_remove_tests::test_volumes_false tests/unit/client_test.py::container_remove_tests::test_volumes_true tests/unit/client_test.py::container_start_tests::test_already_running tests/unit/client_test.py::container_start_tests::test_container_with_id tests/unit/client_test.py::container_start_tests::test_container_with_id_and_name tests/unit/client_test.py::container_start_tests::test_container_with_name tests/unit/client_test.py::container_start_tests::test_containername tests/unit/client_test.py::container_start_tests::test_no_such_container tests/unit/client_test.py::container_start_tests::test_str tests/unit/client_test.py::container_wait_tests::test_0 tests/unit/client_test.py::container_wait_tests::test_42 tests/unit/client_test.py::container_wait_tests::test_container tests/unit/client_test.py::container_wait_tests::test_containername tests/unit/client_test.py::container_wait_tests::test_no_such_container tests/unit/client_test.py::container_stop_tests::test_already_stopped tests/unit/client_test.py::container_stop_tests::test_container tests/unit/client_test.py::container_stop_tests::test_containername tests/unit/client_test.py::container_stop_tests::test_no_such_container tests/unit/client_test.py::container_stop_tests::test_normal tests/unit/client_test.py::container_stop_tests::test_timeout tests/unit/client_test.py::container_restart_tests::test_container tests/unit/client_test.py::container_restart_tests::test_containername tests/unit/client_test.py::container_restart_tests::test_no_such_container tests/unit/client_test.py::container_restart_tests::test_normal tests/unit/client_test.py::container_restart_tests::test_timeout tests/unit/client_test.py::container_kill_tests::test_container tests/unit/client_test.py::container_kill_tests::test_containername tests/unit/client_test.py::container_kill_tests::test_no_such_container tests/unit/client_test.py::container_kill_tests::test_normal tests/unit/client_test.py::container_kill_tests::test_sighup tests/unit/client_test.py::container_kill_tests::test_sigint tests/unit/client_test.py::container_upload_tests::test_container tests/unit/client_test.py::container_upload_tests::test_containername tests/unit/client_test.py::container_upload_tests::test_incompatible_remote_api tests/unit/client_test.py::container_upload_tests::test_overwritedirnondir tests/unit/client_test.py::container_upload_tests::test_readonly tests/unit/client_test.py::container_upload_tests::test_str
CHANGELOG xd/docker/client.py
CHANGELOG xd/docker/client.py