Amazon ECS Error: Cannot Create Task Definition Without Containers
I am following a tutorial regarding using docker compose with AWS ECS service located here .
I am using Ubuntu 16.04 and the ecs-cli installation was successful. However, I am getting the following error when I try to run sudo ecs-cli compose up
in the directory containing the docker-compose.yml file
ERRO [0000] Unable to open error ECS Compose Project = "cannot create task definition without containers, invalid service configuration"
FATA [0000] Unable to create and read ECS project Compose error = "cannot create task definition without containers; configuration service"
How are docker-compose.yml files and add-on multi-container docker apps to be used with AWS ECS?
source to share
I had the same problem and found it had to do with the formatting of the yml file. If you did a direct copy and paste of the compose yml, it is missing the correct indentations. Correct them and it will work.
version: '2'
services:
web:
image: amazon/amazon-ecs-sample
ports:
- "80:80"
source to share