简体   繁体   中英

Does every docker compose yml file is compatible with AWS ECS containers

I have a docker-compose yml file. It contains 11 services/sections. I am able to successfully deploy it on Ubuntu EC2 instance.

Now, I need to host each service/ section from Docker Compose inside AWS ECS. As per my understanding, I need to create a task definition from AWS ECS UI. I can look at my docker-compose file for image details, environment variables, labels, and just add it inside the task definition. Then, start the task. Now, my ECS tasks should work without any additional settings.

Is this a correct understanding that any service/section docker-compose yml file is ECS compatible?

To my understanding, ECS still doesn't allow the build command in docker-compose.yml so you will run into some headaches. You can build separate images on ECR and have your docker-compose file to run those when you are creating your services. Don't forget to rebuild those images when you are deploying new code.

Sample docker-compose file

version: '3'
services:
  web:
    container_name: web
    image: some_repository/web:latest
  db:
    container_name: db
    image: some_other_repo/db:latest

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM