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

docker build fails with "Error removing intermediate container: The given container is <nil>" #8663

Closed
mephi42 opened this issue Oct 20, 2014 · 3 comments

Comments

@mephi42
Copy link

mephi42 commented Oct 20, 2014

$ docker --version
Docker version 1.3.0, build c78088f

I'm running a build, step 4 of which takes ~40min and creates ~2Gb of data. After it completes successfully, the following happens:

[[ Heavyweight step 4 success message here ]]
 ---> f3d3ea79dc14
Error removing intermediate container 44eb058fc224: The given container is nil
Step 5 : RUN [[ next command ]]
2014/10/20 13:25:26 No such id: b24142b94e2ed2d8014d67883e92124d44bea14eae76798e92489b29a76ab1c6
@mephi42
Copy link
Author

mephi42 commented Nov 2, 2014

Found the following line in crontab:

*/5 * * * * docker rm $(docker ps -a -q)

Obviously it interfered with docker build.

@ndessart
Copy link

As of docker 1.12.1 this is still an issue. Running docker rm $(docker ps -a -q) while another process is building an image might remove intermediate containers. It seems not possible to filter out intermediate containers from the docker ps command. Also the docker build command is successful even if intermediate containers have been removed. In this case the produced image does not contain the layer associated with the removed intermediate container.

@thaJeztah
Copy link
Member

@ndessart improvements are coming; in 1.13, data management functions are added to make it easier to remove old images, containers, etc (see #26108), also --rm is moved to the daemon (currently it's a client-side implementation), see: #20848. I think that will resolve the race where the client tries to remove the intermediate container that has already been removed

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

3 participants