Docker compose considers the build context as a relative path instead of a URL

374 Views Asked by At

Docker compose consider the build context as a relative path, although it is in fact a GitLab URL.

docker-compose.yml (I use an access token for GitLab authentication)

version: '2'
services:
  myservice:
    build:
     context: [email protected]:myproject/myservice.git#dev-1.0

Error message

build path /mnt/sda1/tmp/test-docker-compose/[email protected]:myproject/myservice.git#dev-1.0 either does not exist, is not accessible, or is not a valid URL.

I tried to put the context between " ", but it is the same.

1

There are 1 best solutions below

1
harpal On

Have you seen it, https://stackoverflow.com/a/50454039/6310485 I think you are missing add colon like at end of your git URL e.g. https://gitlab.mycompany.com:myproject/myservice.git#:dev-1.0