Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
ECS Fargate does not support bind mounts

I am trying to deploy a nodejs docker-compose app into aws ecs, here is how my docker compose file looks -

version: '3.8'

services:
 sampleapp:
  image: jeetawt/njs-backend
  build:
   context: .
  ports:
   - 3000:3000
  environment:
   - SERVER_PORT=3000
   - CONNECTIONSTRING=mongodb://mongo:27017/isaac
  volumes:
   - ./:/app
  command: npm start

 mongo:
  image: mongo:4.2.8
  ports:
   - 27017:27017
  volumes:
   - mongodb:/data/db
   - mongodb_config:/data/configdb
volumes:
 mongodb:
 mongodb_config:

However when i try to run it using docker compose up after creating ecs context, it throws below error -

WARNING services.build: unsupported attribute        
ECS Fargate does not support bind mounts from host: incompatible attribute

I am not specifying any where that I would like to use Fargate for this. Is there any way I can still deploy the application using ec2 instead of Fargate?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Default mode is Fargate. You presumably have not specified an ecs cluster with ec2 instances in your run command.

Your docker compose has a bind mount so your task would need to get deployed to an instance where the mount would work.

This example discusses deploying to an ec2 backed cluster. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cli-tutorial-ec2.html

over 4 years ago · Santiago Trujillo Report

0

Fargate is the default and there is no way to tell it that you want to deploy on EC2 instead. There are however situations where we have to deploy on EC2 when Fargate can't provide the required features (e.g. GPUs).

If you really really need to use bind mounts and need an EC2 instance you may use this trick (I haven't done it so I am basically brainstorming here):

  • configure your task to use a GPU (see examples here)
  • Convert your compose using docker compose convert
  • Manually edit the CFN template to use a different instance type (to avoid deploying a GPU based instance with its associated price)
  • Deploy the resulting CFN template.

You may even be able to automate this with some sed circus if you really need to.

As I said, I have not tried it and I am not sure how viable this could be. But it wouldn't be too complex I guess.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!