简体   繁体   中英

Bower + Git submodules + Docker compose

I have 6 git sub-modules each with their own Dockerfile . I've setup my docker-compose.yml in this format:

a:
  build: A
  dockerfile: Dockerfile
  ports:
    - "9000:9000"

b:
  build: B
  dockerfile: Dockerfile
  ports:
    - "3000:3000"

c:
  build: C
  dockerfile: Dockerfile
  ports:
    - "3001:3001"

A couple of my Dockerfiles have a step for bower to install the dependencies, but when this happens it errors out with the following message:

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/C

Additional 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

I had the same issue when using bower inside a Docker container, which was composed with docker-compose. This workaround did it for me (although this is not really satisfying):

GIT_DIR=/tmp bower install --allow-root

This pull request should fix it, but has not been merged yet.

Don't know if you've tried this already but try running the following command:

git config --global url."https://".insteadOf git://

If this don't work you could try to configure the proxy/ports in the .bowerrc file.

Found some references here and here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM