0

Currently I'm using task-definitions that refer to custom images in dockerhub to deploy my webapp on ECS (Amazon EC2 Container Service). Is there a way to do this without going through dockerhub i.e. build/deploy the dockerfile locally across cluster nodes?

At the moment, I can only think of sending shell commands over ssh or using a tool like ansible.

Perhaps I'm missing something totally obvious here...

freefood89
  • 301
  • 2
  • 9
  • do you want to use "base images" and improve them? or you want to build your own images and then push/pull them? – tedder42 Aug 10 '15 at 03:42

2 Answers2

2

This is a little late for an answered question, but I just figured this out myself. The EC2 Container Registry (ECR, Amazon's repository equivalent) is working well for me, maybe didn't exist at the time?

I build the containers locally. Tag them and push them to Amazon's ECR using the AWS CLI (later versions of which include support for ECR), and then refer to them at that location in the task definitions in ECS. Works like a charm.

http://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html

geeklight
  • 88
  • 7
1

ECS is a service to run containers, not to build them. It has no native support for it, so you're not missing something obvious.

As you suggest, you could distribute a Dockerfile to the container instances and build locally, but that will actually be more difficult since the container instances must have everything needed to build the image, plus you'd have to distribute the image to the other container instances.

You could run a repository yourself and specify a different repository-url for the image parameter in your ECS task definition. You'd still be responsible for building the images and now the added burden of running a repository as well.

Sorry to be the bearer of bad news but there's not a simpler workflow for this at the moment.

Ben Whaley
  • 32,811
  • 7
  • 87
  • 85