v3

latestOpenAPI 3.0.0raw.githubusercontent.com2026-02-14107155281.0 KB

Create a new image from a container

post/commit

Query parameters

containerstring
repostring
tagstring
commentstring
authorstring
pauseboolean
changesstring

Request body

Hostnamestring

The hostname to use for the container, as a valid RFC 1123 hostname.

Domainnamestring

The domain name to use for the container.

Userstring

Commands run as this user inside the container. If omitted, commands run as the user specified in the image the container was started from.

Can be either user-name or UID, and optional group-name or GID, separated by a colon (<user-name|UID>[<:group-name|GID>]).

AttachStdinboolean

Whether to attach to stdin.

AttachStdoutboolean

Whether to attach to stdout.

AttachStderrboolean

Whether to attach to stderr.

ExposedPortsobject nullable

An object mapping ports to an empty object in the form:

{"<port>/<tcp|udp|sctp>": {}}

Ttyboolean

Attach standard streams to a TTY, including stdin if it is not closed.

OpenStdinboolean

Open stdin

StdinOnceboolean

Close stdin after one attached client disconnects

Envstring[]

A list of environment variables to set inside the container in the form ["VAR=value", ...]. A variable without = is removed from the environment, rather than to have an empty value.

Cmdstring[]

Command to run specified as a string or an array of strings.

ArgsEscapedboolean nullable

Command is already escaped (Windows only)

Imagestring

The name (or reference) of the image to use when creating the container, or which was used when the container was created.

Volumesobject

An object mapping mount point paths inside the container to empty objects.

WorkingDirstring

The working directory for commands to run in.

Entrypointstring[]

The entry point for the container as a string or an array of strings.

If the array consists of exactly one empty string ([""]) then the entry point is reset to system default (i.e., the entry point used by docker when there is no ENTRYPOINT instruction in the Dockerfile).

NetworkDisabledboolean nullable

Disable networking for the container.

OnBuildstring[] nullable

ONBUILD metadata that were defined in the image's Dockerfile.

Labelsobject

User-defined key/value metadata.

StopSignalstring nullable

Signal to stop a container as a string or unsigned integer.

StopTimeoutinteger nullable

Timeout to stop a container in seconds.

Shellstring[] nullable

Shell for when RUN, CMD, and ENTRYPOINT uses a shell.

Response

The request has succeeded.

Idstring required

The id of the newly created object.