Building a Docker image from a private GitHub repository with docker-compose

Viewed 3390

I know it's possible to supply a GitHub HTTP URL as a service's build context:

version: '3.9'

services:
  my-app:
    build: https://github.com/rambo/my-app.git

The above works well for public repos. But what if the Dockerfile is stored in a private repo that requires authentication (e.g. via SSH). Is something like the below example supported?

services:
  my-app:
    build: ssh://git@github.com:rambo/my-app.git

I've tried multiple variations of the above configuration but nothing seems to work.

1 Answers
Related