我有6个git子模块,每个子模块都有自己的Dockerfile.我用这种格式设置了docker-compose.yml:
a:
build: A
dockerfile: Dockerfile
ports:
- "9000:9000"
b:
build: B
dockerfile: Dockerfile
ports:
- "3000:3000"
c:
build: C
dockerfile: Dockerfile
ports:
- "3001:3001"
我的几个Dockerfiles有一个步骤让bower安装依赖项,但是当发生这种情况时,它会出现以下错误:
bower open-sans#~1.1.0 resolve
git://github.com/bungeshea/open-sans.git#~1.1.0 bower
foundation#~5.5.1 ECMDERR Failed to execute “git ls-remote
–tags –heads git://github.com/zurb/bower-foundation.git”,exit code of #128 fatal: Not a git repository: ../.git/modules/CAdditional error details: fatal: Not a git repository:
../.git/modules/C Service ‘web’ Failed to build: The command
‘/bin/sh -c npm install && npm install -g bower && bower install
–allow-root && npm install -g gulp && gulp build’ returned a non-zero code: 1
最佳答案
在Docker容器中使用bower时遇到了同样的问题,该容器由docker-compose组成.这个解决方法为我做了(尽管这并不令人满意):
GIT_DIR=/tmp bower install --allow-root
这个pull request应该修复它,但还没有合并.