I have a git repository placed in local file system at /home/nou/code/lib.git
Also I have /home/nou/docker-compose.yaml
that is used to deploy a service based on the code from the repo:
version: '2'
services:
lib:
container_name: lib
build: git://./code/lib.git/
#build: git://./code/lib.git
#build: git:///home/nou/code/lib.git/
#build: git://file:///home/nou/code/lib.git/
As you can see, am trying to build lib service from the local git repo, but the only result I observe is such error (or similar):
nou@ubuntu:~/$ docker-compose build
Building lib
ERROR: error fetching: fatal: unable to connect to .:
.: No address associated with hostname
: exit status 128
How can I use local git repo to build services using docker-compose?
build: file:///home/nou/code/lib.git/
should dogit://
is essential in this config line for the repo to be pulled (using git) before the build is actually executed. In other words - not a plain URI, but a git URI.