r/linuxquestions • • May 12 '20

Why Docker?

I hear a lot that people run server applications (like Pi-Hole, Nextcloud etc) in Docker containers, for example on their Raspberry Pis at home. Is there any obvious advantage by using Docker opposed to simply putting the server applications on the Pi directly?

As my (very limited) knowledge on that topic goes, using Docker adds just another layer of ballast.

129 Upvotes

90 comments sorted by

16

u/Paul_Aiton May 12 '20

Containers are primarily an orchestration tool. Developers can write a micro-service in an interpreted language, bundle all the libraries with it, and pass it off to an operations team / service to push them out as a contained unit. If you're writing software that's going on to a single machine that you're the owner / admin of, containers don't provide much value but have quite a bit of management overhead.

Is there any obvious advantage by using Docker opposed to simply putting the server applications on the Pi directly?

No. Not unless you're more familiar with docker than a configuration management tool and would prefer to do that, but even then you'll still need to set the RPi up to accept the container workload.

1

u/daPhipz May 12 '20

So you can say Docker images are the server usecase equivalent to snaps on the Desktop?

2

u/Paul_Aiton May 12 '20

I don't know enough about snaps to say what they're for. To the best of my knowledge they're Canonical's NIH answer to flatpacks, and flatpacks are an attempt at software packaging in a distro agnostic manner. But again, that's my completely ignorant conception of them.

1

u/daPhipz May 12 '20

Yes, Snaps are an attempt at making software packaging easy and as frictionless as possible for developers. The analogy I see here is that all dependencies your program needs in order to function are bundled together with your software in a snap. That way, the developer can make sure that he ships an environment that is working as expected and doesn't rely on third party dependencies that are potentially outdated.

4

u/Atemu12 May 12 '20

doesn't rely on third party dependencies that are potentially outdated

...or updated.

3

u/gnosys_ May 12 '20

they are similar only in that both are called "containers" and both have runtimes written in golang. completely different purposes and design, Docker puts a custom execution environment around a process or maybe a couple and knits together all the different bits and pieces through virtualized network communication (this is to make things "scalable", you can knit together several servers as a cluster and spawn more processes of one kind or other as they're needed). Snaps put a custom execution environment around a complete application with the idea that it is decoupled from the host system in a few interesting ways. Snaps are all-in-one, and meant to be a way for system users to consume software. Docker containers are convenient minimal execution platforms for small pieces of a larger service system.

2

u/smog_alado May 12 '20

What about using containers only in the development machine, to recreate the production environment? Is that worth the hassle?

6

u/Paul_Aiton May 12 '20

To me? Absolutely not. For someone else, maybe.

I think it would be better to have the conceptualization that the container platform target (if done right,) is independent of environment. You would not program "on" development, then on QA, then on Prod. You would submit code to a repository that triggers a pipeline to construct a container artifact. That artifact is deployed to a QA environment that would have automated and manual tests run against it, and if it passes and is approved, the entire artifact would go to prod.

If you're an individual who is programming alone for deployment to their own hardware, containers add a lot of management overhead, and the benefits will be dependent on what parts you get the most value out of spending the time to automate away. If you are targeting containers for full manual deployment, you're almost certainly wasting time with containers.

1

u/smog_alado May 12 '20

In my case I like using Fedora on my laptop but I'd rather use Debian or Ubuntu on my web server.

What I was wondering is if it would be worth learning about containers so I could use an Ubuntu container for development. Or if I should should just bite the bullet and reformat my hard drive in a dual boot configuration. I'm not planning on using containers on the web server. What do you think about this?

2

u/Paul_Aiton May 12 '20

I wouldn't want to do that, but if it works for you go for it.

I'm not personally a fan of containers, and mostly stick to Ansible and VMs. But I also stick to just Fedora for my home needs (RHEL at work.) I come from a heavy Linux admin / engineer background though, and didn't come up the developer route; containers seem to be more popular for those guys.

2

u/Ran4 May 12 '20

Sometimes. But mostly, no, it's simply too slow and cumbersome. When developing you're typically running unit tests all the time, and docker usually slows that down by a lot.

2

u/[deleted] May 12 '20

but have quite a bit of management overhead.

You're the only person in the comment section so far recognizing this... Containers ain't free.

86

u/funbike May 12 '20 edited May 12 '20

Docker gives similar benefits to a VM, but is very lightweight. There is negligible difference between running a normally installed app and that same app in a container, in terms of memory, cpu performance, or disk speed. There can be significant disk space overhead, however, depending on the images you use.

A container image usually consists of a distro and application(s), but not a kernel or init system. The host kernel is shared with the containers.

There are many benefits.

  • If set up properly (e.g. non-root user), a compromised app cannot affect your host system. No services run in a container, only the app you specify. No ports are accessible, except those you specify. You can make the entire file sytem read only. You can isolate a container's network from the host and other containers.

  • Most or all of the app setup and configuration is packaged into a container, often by an expert. This can be a huge time savings.

  • You can start over at any time. You can blow away a container in seconds. If you want, you can spin it back up in the original state.

  • You can run many containers at a time. There is little overhead except for whatever resources the apps take.

TBH, I don't see many downsides compared to a traditional app install. Maybe some people are scared of the unknown? Keeping containers updated can be an issue. There are other similar technologies I like better, like podman. I'd use Kubernetes if I was dealing with a web scale app.

(edits: based on comments.)

55

u/svet-am May 12 '20

be careful on advertising the security angle. containers definitely provide separation but they don't actually have much in the way of security provisioning. i work in this segment of the industry and we don't even really trust actual VMs (eg, Xen or KVM) as a security features and containers even less so.

19

u/Paul_Aiton May 12 '20

I agree with you. I think the security angle of containers is an overhype situation. Any security they do provide is minimal and could be done better with SELinux and standard DAC.

8

u/tigerfishbites May 12 '20

From a security perspective, containers DO provide an atomic deployment model, which prevents bespoke server configs, and enables easy patching. I think that's a boon

4

u/geggam May 12 '20

enables easy patching

Also creates problems tracking exploitable versions of libraries deployed

2

u/Paul_Aiton May 12 '20

That is true. There are OTHER ways of doing that, in particular I've been using Ansible a lot lately, and I just assume that if a servers are being configured for a consistent docker host, it's no different to configure a VM directly vs a pipeline that's configuring your container artifacts.

5

u/michaelkrieger May 12 '20

Don’t forget that it’s only as secure as the maintainer of the docker image updating it for dependency security updates. It’s more delays in getting a security update to your system. The number of docker images I’ve seen without the latest updates astound me.

3

u/[deleted] May 12 '20

I bet we can agree that the base security is higher when running an app in docker than having to take care of all security aspects yourself. cgroups, ulimit, iptables, SElinux... much less of an issue with docker I imagine.

6

u/[deleted] May 12 '20

I disagree because there's plenty of docker images that run as root, or ask you to mount the docker socket inside the container itself.

The docker daemon is a security nightmare. And in addition, containers allow you to easily bypass auditing: docker run -v /:/host fedora:latest bash -c 'rm - rf /host'

There's plenty of ways of shooting yourself on the face. Podman follows a much better security model and allows rootless containers (but still lacks some features, like nested podman in unprivileged containers)

1

u/[deleted] May 12 '20

there's plenty of docker images that run as root

Maybe I need to read up on why that's bad, but could you explain why it's bad? Is jailbreaking really that easy?

or ask you to mount the docker socket inside the container itself

I have seen one single image doing that (nginx-proxy) and it was a pretty valid usecase. What kind of images are you finding that willy-nilly require access to the docker-socket?

The docker daemon is a security nightmare

If you could expand on that a little...

And in addition, containers allow you to easily bypass auditing: docker run -v /:/host fedora:latest bash -c 'rm - rf /host'

That's like saying linux isn't secure because I can run sudo rm -rf /. If you're mounting your root into a container then what in the world do you need a container for?

There's plenty of ways of shooting yourself on the face

You're describing pretty much every tool.

1

u/[deleted] May 12 '20 edited May 12 '20

Maybe I need to read up on why that's bad, but could you explain why it's bad? Is jailbreaking really that easy?

root inside the container is root outside the container unless you use subuid/subgid mapping (which podman does).

so the container will have full access tk any mounted volumes. If an application is compromised then the attacker will get root, albeit contained.

Ideally you want to run as non-root, so that there will be more layers. But sadly that's up to the image writer to do.

or ask you to mount the docker socket inside the container itself

I have seen one single image doing that (nginx-proxy) and it was a pretty valid usecase. What kind of images are you finding that willy-nilly require access to the docker-socket?

The docker socket gives root access, if your nginx instance gets compromised they can simply bypass any protections via: docker -v /:/mnt fedora

They would then get full root access to your system and you'd have no audit logs about it.

The docker daemon is a security nightmare

If you could expand on that a little...

And in addition, containers allow you to easily bypass auditing: docker run -v /:/host fedora:latest bash -c 'rm - rf /host'

That's like saying linux isn't secure because I can run sudo rm -rf /. If you're mounting your root into a container then what in the world do you need a container for?

No, the point of this is that whatever you(the attacker) do in that container will be logged to the filesystem inside the container and there will not be any traces after the container is removed.

 $ docker -v/:/host fedora:latest bash
 $ # add backdoor
 $ exit
 $ # no logs about intrusion in the system :)

You're describing pretty much every tool.

No. Podman runs rootless, without a daemon and without a socket that provides root access. It has way better defaults imo at least when it comes to security.

The docker socket is insane

2

u/aoeudhtns May 12 '20

Disregarding specific bugs that allow for container escape, certain setup mistakes can also have that risk.

You need to make sure your host is set up with correct ulimits, iptables rules, and ideally you'll also SELinux label the container and attach a policy to it, in case it is taken over.

Containers do not subtract from what you have to do. You're literally adding a subsystem into your deployment. They add to what you need to do, if you're rolling the whole stack yourself. Obviously you can use shared hosting and hope that the host provider knows what they're doing, and only worry about your containers.

2

u/[deleted] May 12 '20

Disregarding specific bugs that allow for container escape

I mean, that's every application. There's no such thing as a bugless app.

certain setup mistakes can also have that risk

And no error-free setup.

If someone exploits your native app, that's it, they have access. Docker adds a jail that has to be broken out of before doing damage to the system.

1

u/aoeudhtns May 13 '20

Yes, but in practice container deployments are sloppy. Lots run as root, most forget to --cap-drop=all, and even still coming up with an AppArmor or SELinux policy for your container process is considered a best practice. Containers don't let you skip host security.

But this conversation is a distraction as most exploits are in the app level anyway. Year after year injection attacks are #1... when will we, as an industry, learn? Although I like to take a mental note when an app bug could have been prevented with host security. There was one a while ago where a PHP app had a RCE through bad GET interpretation. If it had been inside a container, and additionally that container had remounted the entire fs noexec except for the application, it would have been mitigated.

1

u/funbike May 12 '20

I changed the wording of the first bullet to just security facts, with no opinion statement.

18

u/edman007 May 12 '20

I would say one of the biggest negatives is security updates. Your system has a whole bunch of packages and you do updates and it updates all the stuff on your system. Notably, it doesn't update the stuff your docker images contain, so all your containers miss out on all system updates. You instead must rely on the image maintainer to update the image and then you must pull the updated image. Often the image never gets updated. This means that while docker is pretty effective at keeping stuff in the containers, it tends to be easier to attack them and the stuff inside the containers is more vulnerable.

3

u/Atemu12 May 12 '20

Depends on how you build your containers. Docker containers built with Nix are updated with the rest of the system if they're declared in your NixOS system declaration.

7

u/jabjoe May 12 '20

Most people use prebuilt docker images and those seam to be mostly Ubuntu or Debian based.

3

u/[deleted] May 12 '20

Quoting nix is like quoting Klingon. Sure it has it's uses and might be superior for some things but who actually speaks it?

1

u/juustgowithit May 12 '20

I never knew (or thought) of that point

1

u/[deleted] May 12 '20

TBH, I don't see any downsides compared to a traditional app install.

It adds significant management overhead and complexity. (ie: what containers do I have running where? Is the container network set up properly? Etc.)

Personally I see no benefit to add a container on a system that only runs one application.

1

u/aaronryder773 May 12 '20

Does Docker have a GUI?

7

u/elmicha May 12 '20

Not built-in, but you can use e.g. Portainer.

4

u/The_Airwolf_Theme May 12 '20

Also some OSes have docker management built into their own GUI, like Unraid.

2

u/funbike May 12 '20

A container can apply windows to your host OS, by adding this to the command line:

-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0

However, be aware this gives the container access to all your other running windows. The above doesn't work with Wayland.

4

u/Lellow_Yedbetter May 12 '20

Correct me if I'm wrong because I'm only learning about X very very recently, but don't all X windows have access to other running windows, which is one of the things wayland is trying to fix?

0

u/geggam May 12 '20

Until you realize the docker daemon runs as root and any container running inside docker has root permissions

Docker in docker for example

3

u/funbike May 12 '20

Simple solutions: 1) Don't ever run as root inside a container. 2) Use podman.

1

u/geggam May 12 '20

or learn cgroups and namespaces without the docker layer.

1

u/funbike May 12 '20

lol, ok, complex solutions then. Whatever makes you happy, I guess. Whoever picks up your work won't be so happy, though.

I'd rather spend that extra time hardening other aspects.

2

u/geggam May 12 '20

I see docker as an abstraction of things you should know if you are running services in production.

If you dont understand what docker is doing you shouldnt be doing it.

Also when you understand what docker is doing you start to question why its needed

1

u/[deleted] May 12 '20

Podman is very specifically not meant for production use

1

u/funbike May 12 '20

Do you have any links? I googled and couldn't find any. I found a lot of articles describing how to use podman in production, but none saying you shouldn't.

I know RH wants you to use openshift for deployment and podman for local development, but that's not quite the same as saying not to use it in prod.

I'd love to see docs that clarify this.

3

u/[deleted] May 12 '20

Nah you are right that is pretty much it

They say this on their website:

. It allows you to create, run, and maintain those containers created from those images in a production environment

so I guess they do expect to be used in production to some capacity.

0

u/[deleted] May 12 '20

[deleted]

13

u/BCMM May 12 '20

A docker image is basically one kernel short of being an OS. It contains a complete standalone userspace.

"A few binaries and dependencies for those binaries" is just an odd way of describing a minimal distro.

0

u/DarthEru May 12 '20

Most Docker images are as you describe, but that is a result of it being more convenient. It is entirely possible to create an image that contains a single statically linked binary that only depends on system calls. See this article for a handy demonstration and a bit more detailed discussion. So you are technically wrong, but you are practically correct because the vast majority of Docker images are indeed built from base images that contain complete, if barebones, userspaces.

0

u/[deleted] May 12 '20

[deleted]

1

u/DarthEru May 12 '20 edited May 12 '20

I think you might be confused as to what point I was trying to make. Though to be honest your comment is a bit scattered and unclear, so I could be wrong on the point you are trying to make, in which case I apologize. The thing I was saying is technically wrong is this statement by u/BCMM:

A docker image is basically one kernel short of being an OS. It contains a complete standalone userspace.

This statement can be true for specific Docker images, and pretty much is true for most images out there*. However, it is not necessary, as a Docker image only requires the minimal dependencies to run the entrypoint of the image, and that minimal set could be as small as a single self-contained binary. Which is pretty obviously not an OS, or even very close to one. Hence the absolute statement above is technically wrong, but since most docker images are based on functional distributions to take advantage of package managers and such, it is practically correct.

Also, I never said or agreed with the statement "Docker is an OS". What I did imply is that Docker images may (and often do) contain an OS (short of the kernel, of course). Re-reading, I do see that I could be read as agreeing with the statement "a Docker image is an OS", which wasn't my intention. A Docker image is no more an OS than a hard drive containing a system installation is, though they can share a similar relationship to an OS.

And just to be more precise, the definition of OS that I'm using is the one that the person I replied to seemed to be using, the colloquial one that combines the kernel with the userspace into a bundle of "software required to make a computer useful". This may not be the "OS Theory" definition, but I think it's a useful one in its own right, and it's important to evaluate arguments in the correct context.

* Actually, to get more technical about it, one component of most OSes that might be missing from most Docker images would be a proper init system. Since a full fledged init is not needed for most Dockerized tasks, it would be reasonable for base images to omit those dependencies to minimize space used. I'm not sure if that is actually the case for most images though.

Edit: Docker images also don't typically contain bootloaders, for obvious reasons, and those would also arguably fall under my admittedly broad definition of an OS. So yeah, my argument is certainly not very rigorous, and it probably would have been better to simply talk about whether Docker images can and must contain full userspaces (they can, but don't have to).

2

u/archie2012 May 12 '20

Let's also not forget docker runs as root.

1

u/sequentious May 12 '20

There are other container solutions, like podman, that don't require root.

I still haven't made the jump to containers from VMs due to some lingering security concerns, but I'd favour podman personally for it's non-root ability.

1

u/BlueWoff May 12 '20

Not the new containers that run as non root. Have a look at podman on Centos 8.

24

u/MoobyTheGoldenSock May 12 '20

One advantage not mentioned is you can just run Docker containers without actually installing anything other than Docker. You can run a dozen containers and then just remove them all and have your vanilla OS. It makes it very easy to get your machine up and running again after a format or swapping out your pi’s SD card.

3

u/Bubbagump210 May 12 '20

The other side of this is avoiding “dependency hell” or conflicting packages on the same system. Want to run 4 different versions of Ruby on the same box with relative ease? Docker.

2

u/djcp May 12 '20

Not disagreeing, but asdf helps greatly not only for ruby but almost anything else you might want multiple versions of.

1

u/Bubbagump210 May 12 '20

In our environment, it is much easier to ship a container around to CI etc than use RVM or asdf. But yes, of course those tools exist. We just found it easier to silo each app into a container. Now, if the dev wants RVM or asdf in the container to help with development and see if something played nice going from 2.3 to 2.4, that was a different story.

That said, there were times where RVM or asdf simply didn’t work as again, dependencies. I need to take an app from 1.8.3 on some ancient CentOS box to 2.4. 1.8.3 wont compile on a newer box and 2.4 wont compile on an older box. The only answer was separate VMs OR better yet separate containers.

The other downside of asdf and RVM we found was that we really wanted an upstream package of each version rather than a locally compiled version - this was more of a compliance play though in production.

1

u/djcp May 12 '20

I didn't mean to imply you'd use asdf for production, only to make some parts of a local dev story better.

2

u/Bubbagump210 May 12 '20

I got you. All that said, containers are such a breath of fresh air to avoid all that dependency pain that plagued my life for the past 20 years.

1

u/isaifmd May 20 '20 edited May 22 '20

I have used asdf for many projects and it's great. In one of my project the pipenv broke, the very thing the provides the virtualisation. In cases like this docker removes the headache.

16

u/PaintDrinkingPete May 12 '20

Scenario: You've a got a "server" you've setup (physical computer, VM, Raspberry Pi, etc), and you want to use it for a particular application.

Option 1: Install and setup the application on the server

  • install and make sure all pre-requisite packages are present and configured. This may include various libraries, database, programming languages, webservers, etc

  • install and configure the package itself

  • make sure everything plays nicely and application works as intended, troubleshot as needed...

Option 2: Run the application from a Docker container

  • Run a single command to download a Docker image file and start it, or a "stack" several Docker images using a tool like Docker-compose

In either case, you'll generally have personal configurations to setup, but usually the Docker option will save a considerable amount of time, plus there are a few other advantages to using containers:

  • compatibility: Using Docker, you can run applications built in a Debian environment on a server running RHEL, for example. This is helpful if the application in question requires specific package versions that may not be available in the repositories of the OS your host system is running.

  • Segregation: because the containers are fully isolated and self-contained, you can have multiple versions of the same application on a single host or multiple applications that require different versions of supporting software without conflicts.

  • Portability: Say you want to move your application to a new environment, or you need to upgrade the host server to a new OS version... w/ out containers that requires ensuring all the data is backed up, capturing necessary configuration files, and then re-installing everything in the new environment. If you're running in containers, however, you generally just need to backup & restore your mounted volumes and then re-deploy your containers on the new system.

It may not always the best or optimal solution, but the above should outline some of the reasons why folks like working with Docker

1

u/[deleted] May 12 '20

Totally agree with you.. especially about portability and the time it takes to get things running. It saves a lot of time especially when you're migrating. I don't use docker though, I switched to podman.

1

u/[deleted] May 12 '20 edited May 12 '20

Option #1 is only harder if the application isn't packaged for your distro.

Typing yum install httpd or apt install httpd is just as easy as docker run httpd and you're still gonna have to setup the way you want it.

Containers give the benefits you said but they're not free

2

u/PaintDrinkingPete May 12 '20

You're right, and I should have been more specific, but I was referring more to installing an application like (as the OP mentioned) Nextcloud... Where it's not just a single package install, but rather having to setup and configure a full suite with database, php, web server, etc

1

u/[deleted] May 12 '20

That's still the same.

Only reason it would be easier it's because that's how Nextcloud decides to package their releases. (because otherwise they'd have to create a fuckton of packages)

No reason you couldn't do yum install nextcloud other than no one has bothered to create that package

1

u/PaintDrinkingPete May 12 '20

Perhaps, but that’s just an example.

I do agree with you if you’re taking about stand-alone packages, and stuff folks would generally run on their desktop/workstation...I tend to rely more on Docker for “server” deployments of applications

2

u/sazrocks May 12 '20

For me, it is helpful that most docker containers are already pre set up. Think of it as downloading a pre done VM image, but without the hassle of a VM. It also allows for running multiple instance of a service really easily. Want to spin up 5 more minecraft servers? Sure, just start 5 more instances with their own ports and be done.

2

u/ZaitsXL May 12 '20

Probably due to the fact that container has everything inside, so once you decide to upgrade or get rid of anything you just drop the container, leaving the host system virgin clean

2

u/EddyBot May 12 '20

something to note is that it doesn't need to be Docker in particular but containerization as a whole (as used in Docker, Podman, Kubernetes, etc.)
one of the big advantages is that you can for example have different Nginx Web server containers with different PHP versions (especially useful if your distro repository doesn't have your desired version) which are cleanly separated or having automatic image updates via watchtower to always be on the latest Web Server/Backend Server security updates without updating your core system

2

u/lycan2005 May 12 '20

I used it on Pi in my production environment. Mainly it is easy to distribute app across the devices without the need to ssh into each Pi and perform update on app. If the Pis are in swarm environment, update app is as easy as 'docker stack deploy -c yourstackymlfile yourstackname'. Wait for a while, then all Pi will run your latest app.

2

u/Gabisonfire May 12 '20

A real world example for a problem I had not so long ago.

I was playing around with jsonnet and needed to convert my files. I tried to install it locally but had dependencies issues. I could've spent time troubleshooting and googling my way through or, what I ended un doing, was as simple as running this:

docker run bitnami/jsonnet:latest -v myfileslocally:myfilesinthecontainer jsonnet -i myfilesinthecontainer/*.jsonnet

To expand a bit on what this command does:

  • docker run bitnami/jsonnet:latest

Run a command in a container using the image bitnami/jsonnet:latest, then exit.

  • -v myfileslocally:myfilesinthecontainer

Mount myfileslocally in the container at myfilesinthecontainer

  • jsonnet -i myfilesinthecontainer/*.jsonnet

The command to run in the container

And there it is. I had all my converted files without tampering with my system.

1

u/gnosys_ May 12 '20

Docker provides a more-or-less guaranteed deployment that is the same no matter what system you run it on. for super complex setups it's one-and-done for a demo server, or a great benefit for being able to upgrade each of the component parts separately.

for a media server on an RPi, it may indeed be radically excessive, and definitely uses considerable resources when you only have 1G of ram.

1

u/GrowHI May 12 '20

Is there a website or repository I can just download preconfigured docker containers? I often install LAMP stack and there are a couple of one click options that work in most Linux distros (like tasksel) but I haven't found one that works for raspberry pi yet.

2

u/computer-machine May 12 '20

Do you mean like hub.docker.com?

1

u/EddyBot May 12 '20

the issue is probably that not all docker images from the default repository (Docker Hub) does support ARM chips like used in the Raspberry Pi

1

u/Chimera_TX May 12 '20

I wasn't sure that I liked docker at first but I have come to really like it after working with containers for a while.

I like that I can basically just build an image and run it wherever I need to whether it be from container registry or building from a Dockerfile. It works really well with making infrastructure more immutable. Rather that patching stuff, I just create a new updated image, regression test and swap the new one in which results in less downtime overall. I don't really want to install a ton of dependencies on hosts if I can avoid it. I'd rather just isolate them to a container.

The benefits grow too when adding container orchestration like Kubernetes. It makes it easier to use containers in things things like HA, services that need to have load balancers, maintaining healthy services, etc.

1

u/[deleted] May 12 '20

From a simple user perspective, it boils down to this:

  • Easily install a complex server program. 1 or 2 lines of Bash makes it happen and you're ready to go. You don't search how to do it on Ubuntu, Fedora, Windows or whatever, it's the same line, same place, same methodology.

  • Allocate only the ports that you want, with a very standard configuration across all Docker containers. No more looking for "how to change listening port for application FooBar", and going through many config settings and breaking things because you're a complete newb in that. With Docker, it's always the same directive.

  • Stop a container, and the service is stopped. Easy, unified way.

  • Remove a container to completely "uninstall" the software. Remove the image to remove all trace of it. No conflicting libraries, no remaining DLLs on Windows, no dependency hell. No version conflicts.

From a developer's perspective:

  • It's simple. No choosing where to put your app, in which directory, which access rights to give, set up users, etc. No. Just a docker container, with a local root account for all you care

Overhead? Yeah, I mean if it's based on Ubuntu or Debian, then it might end up 1GB in size for a simple Python app. Alpine-based images are much tinier, but slower. Other than that, I wouldn't put much care into resources.

1

u/MorallyDeplorable May 12 '20

I use LXC for what most people would use docker for.

1

u/Gabisonfire May 12 '20

I use Arch btw

1

u/MorallyDeplorable May 12 '20

Not really what I was getting at, more of just pointing out there are options.

1

u/Gabisonfire May 12 '20

I was just kidding.

Why do you use LXC over docker?

1

u/Upnortheh May 12 '20

At work we don't use Docker, but we use LXC containers on Proxmox hosts. While containers fit well as "cattle", all of our containers are "single purpose" servers and are "pets."

The containers function like bare metal systems but use the host system's kernel.

A nice twist to LXC is the operating system in the container can be different from the host and there are no conflicts.

A notable difference with using containers rather than bare metal is restarting a container takes less than 30 seconds as opposed to several minutes for a bare metal system. Very nice with respect to down times.

We have only three full scale KVMs on the Proxmox hosts -- all Windows.

1

u/pag07 May 12 '20

Afaik docker can run other operation systems too. Windows and Linux at least.

For some strange reason I run a proxmox cluster at home on 3 nodes to have Ubuntu in a VM on each node to join the nodes in a Kubernetes cluster to run container.

1

u/pag07 May 12 '20

No matter what you do to get the pi hole running in a docker container: if you fuck it up just restart the container and try again.

Compared to not beeing able to ssh I to you VM because you deleted an interface or what ever.

And it is guaranteed to run everywhere where docker runs.

1

u/Kessarean May 13 '20

I think a decent amount of it is it's ease of use and modularity, additionally, being able to control micro services.

I will admit, it's made me lazy. Anytime I see an app with a docker container for my home lab, I never opt for the manual install. I literally run 2 commands, update my port forward, DNS and reverse proxy and the app is ready. Whole thing takes maybe 5 minutes

1

u/Mgladiethor May 15 '20

doesnt pollute your system

1

u/Candid-House Jun 01 '20

I like to pay millions of dollars to IBM so I switched over to Podman

-1

u/bartturner May 12 '20

I just love Docker and containers. It all comes down to dependencies and managing.

It is just so much easier when you use containers. But without any additional overhead. Containers (Docker) is just a different view of the system. It is passive.

In a way containers is so simple but it is just a fantastic abstraction to work with.

0

u/[deleted] May 12 '20

[deleted]

1

u/RagicMabbit May 13 '20

I’m curious what would common place security holes be for example as I am currently looking into setting up some containers?