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-compose build hangs #2499

Closed
ghost opened this issue Jan 24, 2018 · 5 comments
Closed

docker-compose build hangs #2499

ghost opened this issue Jan 24, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 24, 2018

Expected behavior

docker-compose build not hanging

Actual behavior

docker-compose build hangs

Information

  • Full output of the diagnostics from "Diagnose & Feedback" in the menu
Docker for Mac: version: 17.12.0-ce-mac49 (d1778b704353fa5b79142a2055a2c11c8b48a653)
macOS: version 10.12.6 (build: 16G1114)
logs: /tmp/871665AF-0A25-4D6B-A826-BF5FFE5BECBA/20180124-140234.tar.gz
[OK]     db.git
[OK]     vmnetd
[OK]     dns
[OK]     driver.amd64-linux
[OK]     virtualization VT-X
[OK]     app
[OK]     moby
[OK]     system
[OK]     moby-syslog
[OK]     kubernetes
[OK]     env
[OK]     virtualization kern.hv_support
[OK]     slirp
[OK]     osxfs
[OK]     moby-console
[OK]     logs
[OK]     docker-cli
[OK]     menubar
[OK]     disk

ID 871665AF-0A25-4D6B-A826-BF5FFE5BECBA

  • docker-compose --verbose build output
SWSMs-Mac-mini:v8 fallara$ docker-compose --verbose build nginx
compose.config.config.find: Using configuration files: ./docker-compose.yaml
docker.auth.find_config_file: Trying paths: ['/Users/fallara/.docker/config.json', '/Users/fallara/.dockercfg']
docker.auth.find_config_file: Found file at path: /Users/fallara/.docker/config.json
docker.auth.load_config: Found 'auths' section
docker.auth.parse_auth: Auth data for {0} is absent. Client might be using a credentials store instead.
docker.auth.load_config: Found 'credsStore' section
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/version HTTP/1.1" 200 566
compose.cli.command.get_client: docker-compose version 1.18.0, build 8dd22a9
docker-py version: 2.6.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.60-linuxkit-aufs, Components=[{u'Version': u'17.12.0-ce', u'Name': u'Engine', u'Details': {u'KernelVersion': u'4.9.60-linuxkit-aufs', u'Os': u'linux', u'BuildTime': u'2017-12-27T20:12:29.000000000+00:00', u'ApiVersion': u'1.35', u'MinAPIVersion': u'1.12', u'GitCommit': u'c97c6d6', u'Arch': u'amd64', u'Experimental': u'true', u'GoVersion': u'go1.9.2'}}], Arch=amd64, BuildTime=2017-12-27T20:12:29.000000000+00:00, ApiVersion=1.35, Platform={u'Name': u''}, Version=17.12.0-ce, MinAPIVersion=1.12, GitCommit=c97c6d6, Os=linux, Experimental=True, GoVersion=go1.9.2
compose.service.build: Building nginx
compose.cli.verbose_proxy.proxy_callable: docker build <- (pull=False, labels=None, target=None, nocache=False, container_limits={u'memory': None}, cache_from=None, extra_hosts=None, network_mode=None, tag='nginx', buildargs={u'ENVIRONMENT': 'development', u'CHARMAP': 'UTF-8', u'PUPPET_MANIFEST': 'nginx.pp', u'ASPNETCORE_ENVIRONMENT': 'Development', u'LOCALE': 'en_GB', u'TIMEZONE': 'Europe/London'}, rm=True, stream=True, path='/Users/fallara/Desktop/v8', dockerfile='./Dockerfile', forcerm=False, shmsize=None)

I also tried to add

127.0.0.1	localhost localunixsocket localunixsocket.local localunixsocket.home

to /etc/hosts

Steps to reproduce the behavior

  1. docker-compose build
@ghost
Copy link
Author

ghost commented Jan 24, 2018

If I do docker build -t nginx -< Dockerfile

It just builds without any problem

@ghost
Copy link
Author

ghost commented Jan 25, 2018

Solved it, I got to the source of the problem, in practice the difference between my docker build command and the one triggered by docker-compose was that docker-compose was sending the whole content of the current folder as a build context, moving only the files needed during the build in a subfolder and keeping the mounted volumes/project files somewhere else made things normal again

@ghost ghost closed this as completed Jan 25, 2018
@tsulatsitamim
Copy link

using dockerignore to ignore node_modules solved my problem

@eko24ive
Copy link

eko24ive commented Apr 9, 2019

using dockerignore to ignore node_modules solved my problem
helped me on windows as well

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 27, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants