0

Motivation:

I have an online API, and for every request I need to make a new docker container and execute the code I receive in the request and then delete the docker container. I have thought about using this image as the standard image for docker in order to keep it lightweight.

Questions:

  • Is it a good method? Since I am worried about the memory usage this method may take. However, I plan to run at most 5 containers at a time and queue all the other requests.

  • Second, what other ways are there to securely make an online compiling API. I researched on the web and found this docker method very interesting since it removes any chance of abusing to the server with a malicious code that a person can write!

1 Answer 1

1
  • Is it a good method? Since I am worried about the memory usage this method may take. However, I plan to run at most 5 containers at a time and queue all the other requests.

Yes this is good method and you can put limit for resource utilisation for docker containers.

Ref: https://docs.docker.com/engine/admin/resource_constraints/#--memory-swap-details

  • Second, what other ways are there to securely make an online compiling API. I researched on the web and found this docker method very interesting since it removes any chance of abusing to the server with a malicious code that a person can write!

I would suggest you to go with virtualisation, otherwise there will be always be a security risk. And docker is best choice for that. Other option is Vagrant, but it will be heavy on resources.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.