Question

Creating and destroying many tiny docker containers

I’m finishing up work on an app for doing coding challenges. It creates a docker container, runs / unit tests the code and immediately destroys the container. The app works great on my local machine (with docker installed) but I’m having trouble figuring out how this is done in production. It’s my understanding that my app will be inside a Docker container, in which case I won’t be able to create other containers within that container. I hope this makes sense.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@MethodX

Running Docker on a VPS isn’t all that different than running Docker locally. You’d install Docker to the VPS, much like how you installed it locally and then execute your commands as you would to perform the tasks you need to perform.

Personally, I prefer Ubuntu or Debian myself, and the installation guides for it as as follows:

https://docs.docker.com/engine/installation/linux/ubuntu/

https://docs.docker.com/engine/installation/linux/debian/

As for running Docker within Docker, it’s doable, but slightly more to manage – but doable :-).

https://blog.docker.com/2013/09/docker-can-now-run-within-docker/

… and a little more recent reading about why DIND isn’t actually needed:

https://github.com/docker/docker/pull/15596