[英]AWS ECS-CLI docker-compose.yml depends_on error "services.nginx.depends_on.0 must be a string"
I was learning FARGATE services using AWS-ecs-cli.我正在使用 AWS-ecs-cli 学习 FARGATE 服务。 I was trying to execute
ecs-cli compose --file docker-compose.yml service start
.我试图执行
ecs-cli compose --file docker-compose.yml service start
。
But the error message said,但是错误信息说,
ERRO[0000] Unable to open ECS Compose Project error="services.nginx.depends_on.0 must be a string" FATA[0000] Unable to create and read ECS Compose Project error="services.nginx.depends_on.0 must be a string"
How can I solve this problem?我怎么解决这个问题? Here is my code about 'docker-compose.yml'
这是我关于“docker-compose.yml”的代码
#docker-compose.yml
version: '3'
services:
nginx:
essential: true
build: ./nginx
image: [ECR Image URI]
restart: always
ports:
- "80:80"
volumes:
- /srv/docker-server
- /var/log/nginx
depends_on:
- container_name: django
django:
essential: true
build: ./fastcampus_test
image: [ECR Image URI]
restart: always
command: uwsgi --ini uwsgi.ini
volumes:
- /srv/docker-server
- /var/log/uwsgi
depends_on:
- django
In YAML, lines that start with -
can be thought of as lists, and lines with a colon are key/value maps.在 YAML 中,以
-
开头的行可以被认为是列表,而带有冒号的行是键/值映射。 In your case you want a list of strings (your error is describing offset 0 of your depends_on list).在您的情况下,您需要一个字符串列表(您的错误是描述您的 depends_on 列表的偏移量 0)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.