Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)...]
like image 575
HelloGriffin Avatar asked Feb 10 '26 10:02

HelloGriffin


1 Answers

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
like image 93
VonC Avatar answered Feb 14 '26 02:02

VonC