Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is docker useful for non webapp applications (e.g. Python scripts)? What is the advantage of using it over LXC/LXD?

I am trying to understand how docker is useful outside of the webapp space.

If for example someone wants to run a python script which downloads global weather data every 12 hours, why would they use docker?

What is the advantage of using docker to Linux LXC/LXD containers?

I am struggling to understand the benefits of using Docker.

like image 217
Greg Avatar asked Jun 07 '17 15:06

Greg


People also ask

What is Docker and why is it useful?

Docker is an open source platform that enables developers to build, deploy, run, update and manage containers—standardized, executable components that combine application source code with the operating system (OS) libraries and dependencies required to run that code in any environment.

Why do we need Docker for Python?

Docker is a containerization tool used for spinning up isolated, reproducible application environments. It is a popular development tool for Python developers. The tutorials and articles here will teach you how to include Docker to your development workflow and use it to deploy applications locally and to the cloud.

Does Docker use LXC?

Docker is developed in the Go language and utilizes LXC, cgroups, and the Linux kernel itself. Since it's based on LXC, a Docker container does not include a separate operating system; instead it relies on the operating system's own functionality as provided by the underlying infrastructure.


1 Answers

If for example someone wants to run a python script which downloads global weather data every 12 hours, why would they use docker?

I wouldn't, in this case. set up a cron job to run the script.

What is the advantage of using docker to Linux LXC/LXD containers?

Docker was originally built on top of LXC containers. Since then, it has moved to a newer standard, libcontainer.

The major benefit here, is cross-platform compatibility with a much larger ecosystem.

The world of linux containers with lxc probably still has a place, but Docker is quickly bringing containers to everyone and not just linux users.

I am struggling to understand the benefits of using Docker.

for me, the big advantage i see in docker is in my development efforts. i no longer have to worry about older projects that require older runtime libraries and dependencies. it's all encapsulated in docker.

then there's the production scaling and deployment story. with the community and user base around docker, there are simple solutions for nearly every scenario - from one server deployments, to auto-scaling and netflix level stuff that i'll never get near.

I'm just finding it difficult to understand Docker outside of a webapp server context

think slightly more broadly to any app or process that runs continuously, providing an API or service for other applications to consume. it's typically web based services, yes, but any TCP/IP or UDP enabled process should be able to work.

database systems, cache systems, key-value stores, web servers... anything with an always running process that provides an API over TCP/IP or UDP.

the big benefit here is encapsulating the service and all of it's runtime dependencies, like i was saying before.

need to run MongoDB 2.3 and 3.2 on your server? no problem. they are both in separate containers, can both run independently.

want to run mysql for this app, and mongo for that app? done.

containerization is powerful in helping keep apps separate from each other, and in helping to reduce the "works on my machine" problem.

like image 125
Derick Bailey Avatar answered Sep 23 '22 21:09

Derick Bailey