0

I am creating a web project using java. Here I am downloading a file from web and I must need to transfer the downloaded file to the docker container. I am using the docker API

PUT /containers/{id}/archive https://docs.docker.com/engine/api/v1.41/#operation/PutContainerArchive

But, this gives error like below:

For copying a simple text file:
{
    "message": "Error processing tar file(exit status 1): unexpected EOF"
}
For copying a tar file:
{
    "message": "Error processing tar file(exit status 1): archive/tar: invalid tar header"
}

Here am using docker API because I must need to do copying the files to the contianer using Java. Understand my case and give your suggestions.

Manoj M
  • 19
  • 4
  • How do you otherwise communicate with the application in the container? Does it have something like an HTTP API that can accept POST request? That would be simpler and safer than using the Docker API. – David Maze Apr 17 '21 at 11:17
  • @DavidMaze I tried this above docker Api using postman. Can you explain why this error came and how to resolve this? – Manoj M Apr 17 '21 at 12:54

0 Answers0