Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
235 views
in Technique[技术] by (71.8m points)

amazon web services - How to run docker image one time in aws on some event and shut down it after that?

I need to know how can I run docker image in aws one time on some event(file upload).

For example: I uploaded files to S3 and then I need to run my docker image one time. I know that I can do something like that with ESC tasks, but in this case I will have constantly running EC2, it's too expensive.

How to run docker image once on every file upload and shutdown it after its running?

P.S. docker image should have at least 8GB memory for working

question from:https://stackoverflow.com/questions/65623434/how-to-run-docker-image-one-time-in-aws-on-some-event-and-shut-down-it-after-tha

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Two major announcements for Lambdas in ReInvent 2020 solves your usecase.

you can easily trigger a Lambda function from S3 Upload, Here is a tutorial


Older approach: Triggering an ECS task from Cloudwatch Event Rule, Here is a tutorial


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...