Hi I'm new to AWS ECS and I'm trying to deploy a docker cluster. I have a private github repo that I want to download to my working directory when my docker container starts, or possibly have it on some ebs volume preloaded that is then mounted by my ECS container instance. What is the best approach to doing this, I've been very overwhelmed by the aws documentation and haven't seen anything that talks about git cloning with credentials or ebs preloaded with source code.

  • You'll probably want to take a look at AWS CodeDeploy.
    – ceejayoz
    Commented Jan 16, 2016 at 3:12
  • 1
    Why are you mounting code from outside your container? Usually, you would build the image to container your code and dependencies so that you don't need to mount anything from the outside (other than configuration or secrets). Anyways, I have an example of using Docker and CodeDeploy together at github.com/andyshinn/docker-codedeploy-example that may help. CodeDeploy would help you pull other bits from S3 or git at build or runtime. However, you lose out on some of the scheduling and scaling properties of ECS.
    – Andy Shinn
    Commented Jan 17, 2016 at 5:09
  • I gave up and just built ami instances that act like my docker containers. I just pull in fresh code on ec2 instance restart via rc.local. There's too much magic going on with this code deploy that I don't understand. Commented Jan 17, 2016 at 23:08
  • This is an old question, but the way I've learn is to build once and run everywhere. I was not aware of this as a best practice since I saw docker as a good way to normalize environments between dev and prod. Also I saw docker as being configurable on startup as a best practice. Now it's obvious docker was built with the immutable state mindset. Commented Jul 7, 2017 at 21:19


You must log in to answer this question.

Browse other questions tagged .