你在运行1.5.2版吗?看起来这最近实际上是在https://github.com/docker/compose/pull/2430中添加的.尝试升级.
例:
--- version: '2' services: redis: image: "redis:3.2.3" hostname: redis redis-commander: build: https://github.com/joeferner/redis-commander.git command: --redis-host redis links: - "redis:redis" ports: - 8081
经测试:
$ docker-compose -v docker-compose version 1.11.2, build dfed245
该文件tests/unit/config/config_test.py
显示:
def test_valid_url_in_build_path(self):
valid_urls = [
'git://github.com/docker/docker',
'git@github.com:docker/docker.git',
'git@bitbucket.org:atlassianlabs/atlassian-docker.git',
'https://github.com/docker/docker.git',
'http://github.com/docker/docker.git',
'github.com/docker/docker.git',
]
这证实了compose/config/config.py#L79-L85
:
DOCKER_VALID_URL_PREFIXES = (
'http://',
'https://',
'git://',
'github.com/',
'git@',
)