Reputation: 131
I am new to AWS. So please bear with me if my question doesn't make sense.
My goal is to run multiple docker containers(with different docker config) in one AWS EC2 instance. So far I have been able to programatically start and stop EC2 instance using java SDK.
I guess for running docker instances in EC2 I will have to use ECS Api(AmazonECSClient - included in AWS java SDK). Unfortunately there are hardly any examples that I am able to find for this using AWS java SDK.
Does anybody know how to accomplish this? Any pointers would be helpful.
Upvotes: 2
Views: 1297
Reputation: 8421
ECS is the container service from amazon and needs you to configure your application to be managed by the service.
If you don't want to use ECS, the only option through ec2 SDK is to define the start of the container through the scripting on user-data section. But you can only control the start of container at the instance bootup.
If you need more control on the docker process start and stop, you may need to add tools for orchestration such as chef, puppet and ansible.
Upvotes: 1
Reputation: 8041
The api documentation here gives a clear enough answer.
You basically;
Upvotes: 2