devcontainers / devcontainers/cli

Support docker-compose build with a `git` remote path as build.context

Open
#367 7 comments 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
TypeScript
Stars
3k
Forks
457
Avg merge
13h 17m
Merged PRs (30d)
6

Description

## Problem
Devcontainer-cli failed to build container with build context pointing to remote path (in this case, git).

sample docker-compose.yml:
```yml
version: '3.9'
services:
workspace:
build:
context: https://my-private-repo/devcontainer.git
dockerfile: jdk.dockerfile
target: jdk15-mvn38-node14
command: sleep infinity
volumes:
- ..:/workspace
```

This `docker-compose.yml` built correctly when using `docker compose` but failed when using `devcontainer-cli build`

## Version

devcontainer@0.27.1 /home/pingu/.nvm/versions/node/v14.21.2/lib/node_modules/@devcontainers/cli

## Log file
```log
pingu@XXXXXX:~/repo/vsnotes/.devcontainer$ devcontainer build --workspace-folder ..
[10 ms] @devcontainers/cli 0.27.1. Node.js v14.21.2. linux 5.10.102.1-microsoft-standard-WSL2 x64.
[273 ms] Start: Run: docker-compose -f /home/pingu/repo/vsnotes/.devcontainer/docker-compose.yml --profile * config
[359 ms] name: devcontainer
services:
workspace:
build:
context: https://my-private-repo/devcontainer.git
dockerfile: jdk.dockerfile
target: jdk15-mvn38-node14
command:
- sleep
- infinity
networks:
default: null
volumes:
- type: bind
source: /home/pingu/repo/vsnotes
target: /workspace
bind:
create_host_path: true
networks:
default:
name: devcontainer_default
Error: ENOENT: no such file or directory, open '/home/pingu/repo/vsnotes/.devcontainer/https:/my-private-repo/devcontainer.git/jdk.dockerfile'
{"outcome":"error","message":"ENOENT: no such file or directory, open '/home/pingu/repo/vsnotes/.devcontainer/https:/my-private-repo/devcontainer.git/jdk.dockerfile'","description":"An error occurred building the container."}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.