docker-compose build hangs
$ docker version
Client:
Version: 1.13.0
API version: 1.24 (downgraded from 1.25)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: darwin/amd64
Server:
Version: 1.12.6
API version: 1.24 (minimum version )
Go version: go1.6.3
Git commit: d5236f0
Built: Fri Jan 20 05:47:10 2017
OS/Arch: linux/amd64
Experimental: false
I'm trying to use docker-compose build but the command hangs:
$ docker-compose build --force-rm
Building integration-test-go
^CERROR: Aborting.
docker-compose.yml contains
version: '2'
services:
integration-test-go:
build:
context: go
dockerfile: go/Dockerfile
and go/.dockerignore has
bin/
coverage/
The same invocation via docker build completes in about a minute:
$ time docker build --force-rm=true go
...
Step 10 : ADD ./Makefile $GOPATH/Makefile
---> 7291ce227751
Removing intermediate container e69e54d81655
Step 11 : ADD ./src/ $GOPATH/src/
---> 690cf13fd4ae
Removing intermediate container 9649280eddff
Successfully built 690cf13fd4ae
real 1m49.268s
user 0m3.688s
sys 0m2.501s
Any idea what's going on here?
Can you try again with --verbose and share the output?
As well as the output of docker-compose version
@shin-
$ docker-compose --version
docker-compose version 1.10.0, build 4bd6f1a
@shin-
$ docker-compose --verbose build
compose.config.config.find: Using configuration files: ./../docker-compose.yml
docker.auth.find_config_file: Trying paths: ['/Users/bfallik/.docker/config.json', '/Users/bfallik/.dockercfg']
docker.auth.find_config_file: Found file at path: /Users/bfallik/.docker/config.json
docker.auth.load_config: Found 'auths' section
docker.auth.parse_auth: Found entry (registry=u'https://index.docker.io/v1/', username=u'bfallik')
docker.auth.parse_auth: Found entry (registry=u'https://468274692891.dkr.ecr.us-east-1.amazonaws.com', username=u'AWS')
compose.cli.command.get_client: docker-compose version 1.10.0, build 4bd6f1a
docker-py version: 2.0.1
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2j 26 Sep 2016
compose.cli.command.get_client: Docker base_url: http://localhost:2375
compose.cli.command.get_client: Docker version: KernelVersion=4.8.17-coreos, Os=linux, BuildTime=2017-01-20T05:47:10.598613119+00:00, ApiVersion=1.24, Version=1.12.6, GitCommit=d5236f0, Arch=amd64, GoVersion=go1.6.3
compose.service.build: Building go
compose.cli.verbose_proxy.proxy_callable: docker build <- (pull=False, stream=True, nocache=False, tag='go', buildargs=None, rm=True, forcerm=False, path='/Users/bfallik/sandbox/go', dockerfile='go/Dockerfile')
@shin-
I've got the same issue, with the same --verbose output.
It seems both @bfallik and I are using AWS ECR.
docker.auth.find_config_file: Trying paths: ['<REDACTED>/.docker/config.json', '<REDACTED>/.dockercfg']
docker.auth.find_config_file: Found file at path: <REDACTED>/.docker/config.json
docker.auth.load_config: Found 'auths' section
docker.auth.parse_auth: Found entry (registry=u'https://index.docker.io/v1/', username=u'<REDACTED>')
docker.auth.parse_auth: Found entry (registry=u'https://<REDACTED>.dkr.ecr.ap-southeast-2.amazonaws.com', username=u'AWS')
docker.auth.parse_auth: Found entry (registry=u'<REDACTED>.dkr.ecr.ap-southeast-2.amazonaws.com', username=u'AWS')
compose.cli.command.get_client: docker-compose version 1.10.0, build 4bd6f1a
docker-py version: 2.0.1
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2j 26 Sep 2016
compose.cli.command.get_client: Docker base_url: http+docker://localunixsocket
compose.cli.command.get_client: Docker version: KernelVersion=4.9.4-moby, Arch=amd64, BuildTime=2017-01-18T16:20:26.924957224+00:00, ApiVersion=1.25, Version=1.13.0, MinAPIVersion=1.12, GitCommit=49bf474, Os=linux, Experimental=True, GoVersion=go1.7.3
compose.project.build: mongo uses an image, skipping
compose.service.build: Building api
compose.cli.verbose_proxy.proxy_callable: docker build <- (pull=False, stream=True, nocache=False, tag='<REDACTED>', buildargs=None, rm=True, forcerm=False, path='<REDACTED>/<REDACTED>/src/api', dockerfile=None)```
Thanks for sharing. I must admit, I'm stumped - doesn't look like anything obvious is happening on the client side that would cause issues to occur while pulling.
Do you see anything relevant in the Docker daemon logs that could indicate a failure while processing the build request?
@shin- I'm trying to follow them with syslog -w -k Sender Docker but I don't see much output when I invoke docker-compose. One line seems suspicious:
Feb 1 19:39:42 xxx Docker[1495] <Notice>: 127.0.0.1:0: dispatcher shutting down: read: Eof
Is there some other way I can view what's going on?
@bfallik Here's what I do when I need to dig in
- Shut down running docker daemon (on Ubuntu,
sudo service docker stop) - Manually start
dockerdwith the debug flag (sudo dockerd --debug) - Run
docker-compose ...command in a separate term and watch logs
@shin- Unfortunately I'm on OSX and I'm not as familiar with it as I might be with Linux. I don't see even a dockerd command available to me. I imagine it's buried somewhere in the Docker for Mac packaging.
I'm less familiar with Mac OS and D4M, but I think you can add "debug": true in the daemon options as shown here, then get the logs the same way you were doing already.
@shin- so this is weird.
When I restart the daemon with "debug": true I don't see any logging from docker-compose. Here's the output:
$ syslog -w -k Sender Docker
...
Feb 1 21:34:09 Brians-MBP-4 Docker[9044] <Notice>: Docker is not responding: Get http://./info: EOF: waiting 0.5s
Feb 1 21:34:09 Brians-MBP-4 Docker[9043] <Notice>: Using protocol TwoThousand msize 8192
Feb 1 21:34:11 Brians-MBP-4 Docker[9044] <Notice>: Docker is responding
Feb 1 21:34:11 Brians-MBP-4 Docker[1496] <Notice>: VM started at 2017-02-01 21:34:11 -0500 EST
^C
$
I added those newlines to note when Docker completed its startup and when I invoked docker-compose.
It's as if my docker client isn't talking to that daemon but I don't have any DOCKER_HOST variable set:
$ env | grep -i docker
$
Really odd. My colleague was able to build the project which I am unable to, on the same version of docker.
So far, I've tried:
- Restore Docker to factory settings
- Uninstall and install Docker
- Remove
~/.docker/config.json
All to no avail.
Sweet mother of god.
There's a SO post which mentions docker-compose build hangs when chrome is open (link)
My colleague was using Safari and his was working. I told him to open chrome and try again. It failed
Armed with this knowledge, I was able to fix by:
- Update Chrome
- Quit Chrome
rm -rf <my repository>- clone and setup repository
docker-composebuild 👍- Open chrome
docker-composebuild 👍
What. On. Earth.
Update This did not last. When I rebooted docker, it started to hang again.
@mrjackdavis that is super weird. I just tested docker-compose after killing Chrome but that didn't workaround my hang so maybe they're separate issues?
@bfallik did you also try it on an empty repository?
I updated the fix in my previous comment
@mrjackdavis No, what did you mean by an empty repository? Which repository?
@bfallik Sorry - I wasn't clear.
I deleted my repository (my project files, with docker-compose.yml at the root). The entire folder. Then cloned it from remote. Do that right after quitting chrome.
Is there an ETA for the fix for this? I haven't been able to use Docker for my projects for over a month now. The workaround to exit Chrome is ridiculous.
Agreed. The chrome workaround isidiotic.
I've settled with a bash script which uses docker build directly. Terrible also, but better than the chrome fix.