user650881
user650881

Reputation: 2505

docker-compose exit code 141

One, and only one, of the nodes defined in a docker-compose.yml file fails to build. docker-compose build exits with return code 141. The same configuration previously built without a problem.

The docker host log file, docker.log, reports an error:

level=error msg="Handler for POST /v1.25/build returned error:
Error processing tar file(archive/tar: invalid tar header):

Upvotes: 5

Views: 5698

Answers (3)

Andrei
Andrei

Reputation: 2332

I had this issue with invalid characters in my image name (no .swp files, no concurrency).

Using upper case letters --> error 141.

Ex. replace: image: my-app-ARM:1.0 with image: my-app-arm:1.0

Seems other had the same issue with invalid characters in branch names: https://forum.gitlab.com/t/docker-compose-exit-code-141-on-shared-runners/9585/4

I found that I was tagging the docker images automatically from branch names and that some branches had invalid characters for tags and that resulted in a exit code 141.

Upvotes: 1

hernvnc
hernvnc

Reputation: 1025

No .swp in my case. A docker-machine restart did it.

Upvotes: 0

user650881
user650881

Reputation: 2505

This can be caused by the presence of a .swp file alongside the Dockerfile without sufficient permission for the current user to access.

For instance, this can be caused by having interrupted execution of docker build using sudo as a more privileged user. In this case, removing the .swp file is sufficient, sudo rm .swp.

Upvotes: 0

Related Questions