Commit a container

POST /commit

Create a new image from a container's changes

Example request:

POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1
Content-Type: application/json

{
     "Hostname": "",
     "Domainname": "",
     "User": "",
     "AttachStdin": false,
     "AttachStdout": true,
     "AttachStderr": true,
     "Tty": false,
     "OpenStdin": false,
     "StdinOnce": false,
     "Env": null,
     "Cmd": [
             "date"
     ],
     "Mounts": [
       {
         "Source": "/data",
         "Destination": "/data",
         "Mode": "ro,Z",
         "RW": false
       }
     ],
     "Labels": {
             "key1": "value1",
             "key2": "value2"
      },
     "WorkingDir": "",
     "NetworkDisabled": false,
     "ExposedPorts": {
             "22/tcp": {}
     }
}

Example response:

HTTP/1.1 201 Created
Content-Type: application/json

{"Id": "sha256:8a0cb365e21b94328e0fe8727ff347051e8bc0292fa8c5d1450a9b1d272bbaa4"}

Json Parameters:

  • config - the container's configuration

Query Parameters:

Status Codes:

  • 201 – no error

  • 404 – no such container

  • 500 – server error

Last updated