Docker Community Forums

Share and learn in the Docker community.

Start container on demand or use long running container

docker

(Maqe) #1

I’m new to docker so maybe my question is weird but here we go.

I have a dotnet core application running in a docker container. The applications main purpose is to convert images on the fly when they are uploaded by a user. For this I use another container with ImageMagick inside. When the user uploads a new image I fire up a new conainer that converts my the image and then closes down. So basically I run docker run [command] and the exit. If a user uploads ten images at the same time I start ten containers, convert the images and closing them down. This can potentially start a lot of containers if lets say there are 100 users uploading images. What do you think about this approach? Is it an anti pattern or is it a pretty common way to use containers? if not, how should I do it instead?

Cheers
Marcus