我正在尝试启动一个docker镜像(https://hub.docker.com/r/parrotstream/hbase/)在Windows 10上
docker-compose -p parrot up但我得到这个错误:
错误: 找不到合适的……
是的,命令需要一个撰写文件,自述文件假定您在执行命令的目录中有一个docker-compose.yml。
您可以在DockerHub的链接存储库中找到一个 鹦鹉流/搬运工-HBase的
实际上 docker-compose.yml 您正在寻找的可能是在他们的github repo中找到的那个 这里 。
docker-compose.yml
version: '3' services: hbase: container_name: hbase build: context: . dockerfile: Dockerfile image: parrotstream/hbase:latest external_links: - hadoop - zookeeper ports: - 8080:8080 - 8085:8085 - 9090:9090 - 9095:9095 - 60000:60000 - 60010:60010 - 60020:60020 - 60030:60030 networks: default: external: name: parrot_default
默认情况下, docker-compose 尝试从名为的文件中读取配置 docker-compose.yml 在你当前的工作目录中。您可以使用覆盖此行为 docker-compose -f <anotherfile.yml> 。
docker-compose
docker-compose -f <anotherfile.yml>
Options: -f, --file FILE Specify an alternate compose file (default: docker-compose.yml)
您需要创建一个docker-compose文件,如下所示
# docker-compose.yml version: '2' services: parrot: image: parrotstream/hbase
然后你可以创建一个构建并运行正在使用
docker-compose build parrot # build image
docker-compose up parrot # run