[英]Start Docker Container with docker-compose
I am trying to start a docker image ( https://hub.docker.com/r/parrotstream/hbase/ ) on Windows 10 with 我试图在Windows 10上启动一个docker镜像( https://hub.docker.com/r/parrotstream/hbase/ )
docker-compose -p parrot up
but I get this error: 但我得到这个错误:
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
Executing the command in the directory with the docker image in it does not work either. 在其中包含docker镜像的目录中执行该命令也不起作用。 I am new to using Docker and I am unsure how to start the container.
我是使用Docker的新手,我不确定如何启动容器。 According to the Docker Hub page of the image, this is all I have to do.
根据图像的Docker Hub页面,这就是我所要做的。 Am I missing something?
我错过了什么吗?
Thanks 谢谢
Edit: 编辑:
As pointed out by the replies, I've downloaded the folder from github, including the docker-compose.yml. 正如回复中所指出的,我已经从github下载了该文件夹,包括docker-compose.yml。 I am currently getting an error because of my permission.
由于我的允许,我目前遇到错误。
ERROR: for hbase Cannot start service hbase: driver failed programming external connectivity on endpoint hbase (5fb66c3b2b0d3092edce09f03cc803cc3ea447c07a1a2135271238de626458c6): Error starting userland proxy: Bind for 0.0.0.0:8080: unexpected error Permission denied
ERROR: for hbase Cannot start service hbase: driver failed programming external connectivity on endpoint hbase (5fb66c3b2b0d3092edce09f03cc803cc3ea447c07a1a2135271238de626458c6): Error starting userland proxy: Bind for 0.0.0.0:8080: unexpected error Permission denied
ERROR: Encountered errors while bringing up the project.
Do I have a wrong configuration in docker? 我在docker中的配置是否错误?
Yes, command needs a compose file and the readme assumes that you have a docker-compose.yml in the directory where you execute the command. 是的,命令需要一个撰写文件,自述文件假定您在执行命令的目录中有一个docker-compose.yml。
You can find one in the linked repository from DockerHub parrot-stream/docker-hbase 您可以在DockerHub的链接存储库中找到一个parrot-stream / docker-hbase
You need to create a docker-compose file as follows 您需要创建一个docker-compose文件,如下所示
# docker-compose.yml
version: '2'
services:
parrot:
image: parrotstream/hbase
then you can create a build and run is using 然后你可以创建一个构建并运行正在使用
docker-compose build parrot # build image
docker-compose up parrot # run
The actual docker-compose.yml
that you are looking for may be the one hosted in their github repo found here . 您正在寻找的实际
docker-compose.yml
可能是在此处找到的github 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
By default, docker-compose
tries to read the configuration from a file named docker-compose.yml
within you current working directory. 默认情况下,
docker-compose
尝试从当前工作目录中名为docker-compose.yml
的文件中读取配置。 You could override this behavior with docker-compose -f <anotherfile.yml>
. 您可以使用
docker-compose -f <anotherfile.yml>
覆盖此行为。
Options:
-f, --file FILE Specify an alternate compose file
(default: docker-compose.yml)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.