Create an image Run in API Explorer

POST /images/create

Pull or import an image.

Headers

Query parameters

  • fromImage string

    Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed.

  • fromSrc string

    Source to import. The value may be a URL from which the image can be retrieved or - to read the image from the request body. This parameter may only be used when importing an image.

  • repo string

    Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image.

  • tag string

    Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.

  • message string

    Set commit message for imported image.

  • changes array[string]

    Apply Dockerfile instructions to the image that is created, for example: changes=ENV DEBUG=true. Note that ENV DEBUG=true should be URI component encoded.

    Supported Dockerfile instructions: CMD|ENTRYPOINT|ENV|EXPOSE|ONBUILD|USER|VOLUME|WORKDIR

  • platform string

    Platform in the format os[/arch[/variant]].

    When used in combination with the fromImage option, the daemon checks if the given image is present in the local image cache with the given OS and Architecture, and otherwise attempts to pull the image. If the option is not set, the host's native OS and Architecture are used. If the given image does not exist in the local image cache, the daemon attempts to pull the image with the host's native OS and Architecture. If the given image does exists in the local image cache, but its OS or architecture does not match, a warning is produced.

    When used with the fromSrc option to import an image from an archive, this option sets the platform information for the imported image. If the option is not set, the host's native OS and Architecture are used for the imported image.

    Default value is empty.

Body

Image content if the value - has been specified in fromSrc query parameter

string string

Body

Image content if the value - has been specified in fromSrc query parameter

string string

Responses

  • 200

    no error

  • 404 application/json

    repository does not exist or no read access

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 500 application/json

    server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

POST /images/create
curl \
 --request POST 'http://api.example.com/v1.44/images/create' \
 --header "Content-Type: text/plain" \
 --header "X-Registry-Auth: string"
curl \
 --request POST 'http://api.example.com/v1.44/images/create' \
 --header "Content-Type: application/octet-stream" \
 --header "X-Registry-Auth: string"
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}