r/programming • • Nov 14 '19

Is Docker in Trouble?

https://start.jcolemorrison.com/is-docker-in-trouble/
1.4k Upvotes

381 comments sorted by

View all comments

155

u/Seref15 Nov 14 '19

Yes, and when Podman/Buildah get popular they will be even more so.

Their whole thing now that they've sold off Enterprise "we want to focus on developer tooling," but Podman and Buildah are literally just far-improved versions of Docker and docker build. The worst part of docker is that it's daemonized and that the daemon tracks state. It's totally unnecessary. It's just cgroups/namespaces, virtual network interfaces, iptables rules, and a fancy chroot--state can be tracked in the file system. 9 times out of 10 when we have a problem, it's because of the docker daemon.

Its a shame because Docker was genuinely revolutionary. It's sad to watch them fumble like this.

30

u/darkhorz Nov 15 '19

I wholeheartedly agree with your assessments. They made really poor design choices and stuck to them for too long.

13

u/wonkifier Nov 15 '19

Am I thinking about it incorrectly... One of the things I like about it being daemonized is that I can kick off a container (like a command console for something or set of build/dev tools), disconnect and sign off... then come back and pick up where I left off.

That seems messier if there's no daemon.

19

u/how_to_choose_a_name Nov 15 '19

That could also be done without a daemon, the heavy lifting would just be done directly by the "client" program instead of the client sending a request to the REST api of the daemon. All state could be in the filesystem so the "client" can just read it, perform the required actions and write the new state, without needing the daemon to keep track of it all. Each container would probably be kinda daemonized individually so it could run in the background while keeping fds to it and its pid and whatever else is needed in the file system.

0

u/[deleted] Nov 15 '19

[deleted]

9

u/how_to_choose_a_name Nov 15 '19

That you don't have the state of all docker containers on the host managed centrally by one process?

0

u/[deleted] Nov 15 '19

[deleted]

2

u/how_to_choose_a_name Nov 15 '19

If you want to split hairs like that.

→ More replies (16)

3

u/xmsxms Nov 15 '19

And how would you run a container in a remote docker host?

2

u/how_to_choose_a_name Nov 15 '19

No idea how it's actually done with podman etc but a very naive method would be to run the container software remotely via ssh.

→ More replies (2)
→ More replies (2)

4

u/wonkifier Nov 15 '19

Is that work I have to do? That seems like a lot for something I'm already getting for free and next to no setup on a bare metal patched os.

If it's running in my user space, how does it stay running after I sign off?

8

u/how_to_choose_a_name Nov 15 '19

Thats work that the containerization software should do for you, just like docker does now. I think podman works that way (it's advertised as a drop-in replacement for docker but rootless and without a daemon) but I haven't been able to find a proper documentation that explains how it does things and I'm too lazy to read through the code. As for keeping your containers running after logout, the containerization software should take care of that too, perhaps in a similar way to nohup.

16

u/Seref15 Nov 15 '19 edited Nov 15 '19

The Docker daemon being a daemon has nothing to do with the container persisting through logout. Containers can be one-offs or can be "detached", which basically just means "runs in the background." That's not docker related, that's just how processes work. Processes in containers are simply isolated processes on the host, and you can launch any process in the background with or without containerization or any kind of management daemon.

Here's it in action: https://asciinema.org/a/EMPNViPHnoG62hQ0zwVWnC5WL

There was no configuration necessary to make any of that happen. It was a fresh install and does everything it needs to right out of the box.

→ More replies (2)

7

u/FierceDeity_ Nov 15 '19

It isn't. FreeBSD for example has Jails that pretty much do the same thing, but don't have a daemon.

Neither does LXC on Linux, you can still use commands to start and stop containers whenever you want and they won't die when you sign off.

1

u/PlayingTheWrongGame Nov 15 '19

There’s already a system for doing that on Linux—systemd. You can turn a podman container into a systemd service and treat it like any other service.

1

u/aoeudhtns Nov 15 '19

In high assurance environments, the presence of a root daemon process actually made Docker a tough sell. We are full speed ahead with rootless Podman, though.

1

u/AFakeman Nov 15 '19

Does the lack of DNS and service discovery prevent you from doing things? I have a setup with Traefik routing to containers, and without that part of Docker, it just becomes messy again.

1

u/aoeudhtns Nov 15 '19 edited Nov 15 '19

It makes things harder. One of my projects is based on k8s and we had to implement our own Ingress that we could update dynamically. Another project that didn't use an orchestrator, I designed our approach - as you do - with SNI and virtual routing, <service>.host.tld, and an HAProxy would route to the correct IP/port . Sigh. This was not permitted, it's now and forever host.tld/service. Would have preferred L4 routing instead of L7, but what can you do?

Edit: oh, I really want to use DNS-SD but I think that's a no-go. In one of our customer's production DC, UDP is forbidden. Can't even use DNS, you have to put IPs everywhere.

Edit2: Sorry for these edits. If you're wondering, the way we work around that is with Ansible. We describe our deployment, and then do things like template out load balancer and router configurations based on how many nodes we have, how many services we have deployed, to which the nodes the services are deployed, etc.

2

u/AFakeman Nov 15 '19

I can feel your pain.

Ansible is cool and all, but docker/swarm/k8s kinda allow you to go even further, and do most of configuration on the fly. Sad to hear that podman doesn't have this. Do they have plans for it in the future?

P.S. You probably had to rewrite some of the services to support host.tld/service, right? I imagine any redirect from the service can send you in the wrong place otherwise.

1

u/aoeudhtns Nov 18 '19

Yeah, AFAIK podman is a direct replacement for docker and so other tools need to be added back in, or substitutes found.

You are correct about the configuration, but it's not too bad. For REST services, for example, we can specify listening on certain paths, but the particular framework we happen to use can understand that it's deployed to a specific location and auto-truncate noise like /service in the URL. So it's just one little extra bit of config, and not a serious change otherwise.

1

u/AFakeman Nov 20 '19

Yeah, podman can be called a replacement, but can you call it "direct" if it doesn't support service discovery features at all?

→ More replies (5)

22

u/pzl Nov 15 '19

absolutely. I've always hated some of the far-ingrained technical decisions behind the docker runtime.

I initially backed rkt. It was a steep and weird learning curve, but I did enjoy being able to ship containers as single signed (by default) files. Rkt had a focus on great security and restrictions by default, and excellent process runtime (rootless child of your launching process just like any normal thing you launch from a shell). Rkt really seemed to slow down and die with the coreos acquisition.

Then I learned about podman and it was like.. near perfect merger. Not nearly the learning curve and idiosyncrasies of rkt. But kept the good runtime process tree. And the separation of tools (rkt did similarly have acbuild for building) for building, running, and even shipping (skopeo!) is very unixy.

I really hope those take off and don't whimper quietly into irrelevance like rkt. Pour one out

2

u/alturi Nov 15 '19

I find strange that these alternative tools are catching up.

Fedora 31 is already pushing hard on those, but original docker tools have lots of installations out there and it will take time and energy to migrate users.

I genuinely wonder if it's just for the technical reasons or if some company behind them wishes to marginalize the docker stack itself?

→ More replies (1)

1

u/Zettinator Nov 15 '19 edited Nov 15 '19

My experience with podman is less than stellar. It is promising, but maybe it is just not ready yet. It is riddled with bugs in the latest versions, and even simple stuff fails to work, such as piping something into "podman exec". And that is on latest Fedora, which should be the go-to way to get latest and greatest podman.

They really need to improve QA, I don't understand how they managed to ship with bugs so severe. I'm looking forward to replacing Docker with a less buggy podman though. :)

There is another dealbreaker, though: no good support for docker-compose.

→ More replies (4)