Compose: docker-compose hangs if a fifo pipe exists in directory hierarchy

Created on 16 Mar 2017  路  4Comments  路  Source: docker/compose

If a fifo pipe exists in the hierarchy on the same level or below docker-compose.yml, it will cause docker-compose build to hang.

How to reproduce:

  • Create docker-compose.yml file
  • mkfifo some-pipe
  • Build it: docker-compose build

Now it hangs while waiting for data to be available in the pipe and you can make it continue, by piping data to the pipe: echo "something" > some-pipe

arebuild docker-py

Most helpful comment

Can confirm this on Sierra. I use a fifo in dev to pipe commands into nodemon. I was able to work around it by adding the fifo to .dockerignore.

All 4 comments

Can confirm this on Sierra. I use a fifo in dev to pipe commands into nodemon. I was able to work around it by adding the fifo to .dockerignore.

find . -type p -exec rm -v {} \;
help you

This can also occur if you're using something like babel-watch that uses fifo in the background.

In my case, I noticed that when docker-compose hung, there was also an odd looking file in the tree named 117725-17-1udywdx.hitg. Deleting that file fixed it.

So to re-iterate what @STRML mentioned above, you can just add some glob to your .dockerignore file that ignores this file. In my case, ./117725*

This issue really a PIA. We have our .dockerignore file like this:

*
!filesforcontainer1
!filesforcontainer2

So basically building multiple containers from single source but with different content.
If we have a fifo somewhere in those two subdirectories above it is impossible to mark them as ignored again because, afaik, exclude has higher priority.

Was this page helpful?
0 / 5 - 0 ratings