Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails on component non-zero exit code when docker build does not #1554

Closed
timfallmk opened this issue Jun 15, 2015 · 12 comments
Closed

Comments

@timfallmk
Copy link

Running docker-compose build --no-cache will fail if one of the Dockerfile commands returns a non-zero exit code. However running docker build --no-cache will return successfully in the same condition.

Example:
Dockerfile has command RUN npm install libxmljs:

npm will return code 137 (a warning) from this command

docker-compose will exit at this stage while docker does not.

I can provide more details of the builds if necessary.

@dnephin
Copy link

dnephin commented Jun 16, 2015

I believe you are mistaken:

Dockerfile

FROM busybox:latest
RUN exit 137
RUN echo "ok"
$ docker build .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon 
Step 0 : FROM busybox:latest
 ---> 8c2e06607696
Step 1 : RUN exit 137
 ---> Running in 804b53a341ac
INFO[0000] The command [/bin/sh -c exit 137] returned a non-zero code: 137

$ echo $?
1

Looks like docker build also exits as soon as it hits a failure.

@timfallmk
Copy link
Author

Hmm, I can't get this to re-occur now after doing an upgrade to 1.3.0 RC3. It could have been an edge case between versions.

I'll reopen if it pops up again.

@timfallmk
Copy link
Author

For anyone encountering this, it appears to be a race condition when running out of memory on the host.

@particle4dev
Copy link

@timfallmk Ah, thanks !!!

@ghost
Copy link

ghost commented Dec 14, 2015

This error can also be recreated by removing a container from the Kitematic interface during a build.

@infl3x
Copy link

infl3x commented Mar 17, 2016

Thank you, @timfallmk! That solved the problem for me 😄

@dmmfll
Copy link

dmmfll commented May 28, 2016

+1 when low on memory

@MarcoCabazal
Copy link

This also happens when renaming a container within Kitematic during a build.

@christiansyoung
Copy link

I got the same error while running out of disk space during a build.

@pkill37
Copy link

pkill37 commented May 29, 2017

Bumping up my droplet's RAM from 512MB to 2GB fixed it as well.

@harkiratsinghdevgan
Copy link

Clear your Cache, it helped me.

https://net2.com/how-to-clean-up-unused-docker-containers-images-and-volumes/

@shahabnft200
Copy link

hello i faced this problem during install xraygen on my vps ubuntu 20.04 lxd how i can fix it ?
Command 'docker-compose -f docker-compose.yml up -d' returned non-zero exit status 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

11 participants