Extract an archive of files or folders to a directory in a container Run in API Explorer

PUT /containers/{id}/archive

Upload a tar archive to be extracted to a path in the filesystem of container id. path parameter is asserted to be a directory. If it exists as a file, 400 error will be returned with message "not a directory".

Path parameters

  • id string Required

    ID or name of the container

Query parameters

  • path string Required

    Path to a directory in the container to extract the archive’s contents into.

  • noOverwriteDirNonDir string

    If 1, true, or True then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa.

  • copyUIDGID string

    If 1, true, then it will copy UID/GID maps to the dest file or dir

Body Required

The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, or xz.

string(binary) string(binary)

Body Required

The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, or xz.

string(binary) string(binary)

Responses

  • 200

    The content was extracted successfully

  • 400 application/json

    Bad parameter

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 403 application/json

    Permission denied, the volume or container rootfs is marked as read-only.

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 404 application/json

    No such container or path does not exist inside the container

    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.

PUT /containers/{id}/archive
curl \
 --request PUT 'http://api.example.com/v1.49/containers/{id}/archive?path=string' \
 --header "Content-Type: application/x-tar" \
 --data-binary '@file'
curl \
 --request PUT 'http://api.example.com/v1.49/containers/{id}/archive?path=string' \
 --header "Content-Type: application/octet-stream" \
 --data-binary '@file'
Response examples (400)
{
  "message": "not a directory"
}
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (403)
{
  "message": "Something went wrong."
}
Response examples (403)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "No such container: c2ada9df5af8"
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}