5

I wish to move some ECS containers out of ECS cluster to spot EC2. What is canonical way to start/stop spot EC2 instance executing docker image. The main reason is that I wish container to have public IP + VPC IP

I do not not wish to reinvent ECS/kubernetes.

Is putting some script in userscript is best solution? How do I get ECR access token? It expires in 12-24 for me.

Max Fry
  • 409
  • 3
  • 8
  • `The main reason is that I wish container to have public IP + VPC IP` you can do this in case of ECS too, also you can have spot instances as well. jand `Is putting some script in userscript is best solution` get token every time when you want to pull or allow IP based access so you will not need token. – Adiii Nov 04 '19 at 18:31
  • I can't pull without doing docker login everyday `Error response from daemon: pull access denied for XXXXXXXX.dkr.ecr.eu-west-2.amazonaws.com/london/YYYYYY, repository does not exist or may require 'docker login'` – user3130782 Nov 04 '19 at 18:52
  • What `network mode` should I use to have Public IP and VPC IP in ECS? I currently use `Network mode: awsvpc` and it only gives VPC IP. – Max Fry Nov 04 '19 at 18:54
  • you can use network mode: bridge with ec2 type ecs services – Adiii Nov 04 '19 at 19:48
  • Correct me if I am wrong. Bridge mode will allow to access hosts Public IP or VPC IP. But host will have 1 IP of each type. Each EC2 has its own Public IP and VPC IP. It would allow to bind same port like 443. – Max Fry Nov 04 '19 at 20:34

0 Answers0