Docker Community Forums

Share and learn in the Docker community.

"docker build" hangs on initial connection

(Aseering) #1

I’m running Ubuntu 16.04 and Docker 1.10 (stock Ubuntu versions of everything; 4.4-series kernel; stock configuration; local Docker, not over TCP or anything fancy; etc).

Sometimes (about one time in 3 for a particular image that I happen to build frequently), when I run “docker build -t <img_name>”, the command immediately hangs, prior to uploading any context (or at least prior to emitting any progress updates on the upload of the context).

The context for this job is not overly complicated – half a dozen files totalling around 100mb. (A couple big binaries and a couple little scripts.)

The command hangs indefinitely – I’ve left it for over an hour with zero output. While it’s hung, Docker (both the client and the server) are using 0% CPU.

I tried running “strace” on the Docker server; it’s hanging on something like this:

[pid 3009] epoll_wait(5, <unfinished …>
[pid 3008] restart_syscall(<… resuming interrupted futex …> <unfinished …>
[pid 3007] futex(0xc82020b508, FUTEX_WAIT, 0, NULL <unfinished …>
[pid 2829] futex(0x2259ea0, FUTEX_WAIT, 0, NULL <unfinished …>
[pid 2827] futex(0xc820024908, FUTEX_WAIT, 0, NULL <unfinished …>
[pid 2826] restart_syscall(<… resuming interrupted futex …> <unfinished …>
[pid 2795] futex(0x2237ba8, FUTEX_WAIT, 0, NULL <unfinished …>

Interestingly, if I let strace sit there watching the server, within approximately a minute it almost always gets un-stuck and continues with the build. All strace does to Docker is slow certain syscalls down, so I assume this is either a kernel bug or (I would guess more likely) some sort of pessimal locking scenario.

Does this sound familiar to anyone?