HelloGriffin
HelloGriffin

Reputation: 111

docker-compose can't use git submodule

I try to build a docker container from git with docker-compose but when I try to do "docker-compose build", it says:

Building network_monitor
ERROR: error initializing submodules: git: 'submodule' is not a git command. See 'git --help'.
: exit status 1

my docker-compose.yml:

version: "3"

services:
    [...(irrelevant services)...]

    network_monitor:
        build: git://github.com/Kruemmelspalter/network_monitor#main
        ports:
            - "10380:80"
        volumes:
            - "./network_monitor/conf:/root/conf"
    [...(irrelevant services)...]

Upvotes: 3

Views: 977

Answers (1)

VonC
VonC

Reputation: 1324977

I would first test the same build, using an HTTPS URL, not a git:// one, using a build context (in Dockerfile v2)

build: 
  context: github.com/Kruemmelspalter/network_monitor#main
  dockerfile: Dockerfile

Or simply:

build: github.com/Kruemmelspalter/network_monitor#main

Upvotes: 1

Related Questions