Live data from Hacker News

Fly To Podman: a script that will help you to migrate from Docker

github.com

141–150 of 152 posts

Re: Fly To Podman: a script that will help you to migrate from Docker

#141
post #102

Just want to say everyone should be using podman. Its architecture is way more sane and integrates with Linux on a far more basic level (a regular process that can be started via systemd, etc. instead of a root daemon. Run it as root to get privileged containers). They've also built an incredible ecosystem around podman itself. Red Hat has been absolutely cooking with containers recently.

I understand that k8s uses containerd or similar daemons to run containers. Do podman's criticisms of docker also apply to k8s?

No. K8s runs containers in a way very similar to Podman. Podman is like a middle point between the simplicity of containerd and the feature set of the Kubernetes Kubelet.

Re: Fly To Podman: a script that will help you to migrate from Docker

#142
post #138

Earlier quoted context omitted.

>> Builds are non-reproducible by default. Every default represents worst practices, not best practices. Commands can and do access the network. Everything can mutate everything. > I think you're conflating software build with environment builds - they are not the same and have different use cases people are after. They're not so different. An environment is just big software. People have come up with schemes for bui…

> They're not so different. An environment is just big software. Containers are not a software development platform, but a platform that can be used in the build phase of software development. They are very different. Docker is not inherently a software development platform because it does not provide the tools required to write, compile, or debug code. Instead, Docker is a platform that enables packaging application…

> > They're not so different. An environment is just big software.

> Containers are not a software development platform, but a platform that can be used in the build phase of software development. They are very different. Docker is not inherently a software development platform because it does not provide the tools required to write, compile, or debug code.

You seem to be arguing about something entirely unrelated. GNU make, Portage, Nix, and rpmbuild also don’t provide tools to write, compile, or debug code.

> Can you do incorrect things in software development? Yes. Can you do incorrect things is containers? Yes. You're doing it wrong.

This is the argument by which every instance of undefined behavior in C or C++ is entirely the fault of the developer doing it wrong, and there is no need for better languages.

And yes, I understand Docker networking. I also understand TCP and UDP just fine, and I’ve worked on low level networking tools and even been paid to manage large networks. And I’ve contributed to, and helped review, Linux kernel namespace code. I know quite well what’s going on under the hood, and I know why a Docker container has, internally, a port number associated with the port it exposes.

What I do not get is why that port number is part of the way you instantiate that container. The tooling should let me wire up a container’s “http” export to some consumer or to my local port 8000. The internal number should be an implementation detail.

It’s like how a program exposes a function “foo” and not a numerical entry in a symbol table. Users calling the function type “foo” and not “17”, even though the actual low-level effect is to call a number. (In a lot of widely used systems, including every native code object file format I’m aware of, the compiler literally emits a call to a numerical address along with instructions so the loader can fix up that address at load time. This is such a solved problem that most programmer, even agency assembly programmers, can completely ignore the fact that function calls actually go to more or less arbitrary numerical targets. But not Docker users — if you want to stick mysql in a container, you need to type in the port number used internally in that particular container.)

There are exceptions. BIOS calls were always by number, as are syscalls. These are because BIOS was constrained to be tiny, and syscalls need to work when literally nothing in the calling process is initialized. Docker has none of these excuses. It’s just a handy technology with quite poorly designed tooling, with nifty stuff built on top despite the poor tooling.

Re: Fly To Podman: a script that will help you to migrate from Docker

#143

Just want to say everyone should be using podman. Its architecture is way more sane and integrates with Linux on a far more basic level (a regular process that can be started via systemd, etc. instead of a root daemon. Run it as root to get privileged containers). They've also built an incredible ecosystem around podman itself. Red Hat has been absolutely cooking with containers recently.

What are the benefits of using Podman and not Docker?

If using Kubernetes, Podman's approach allows you to share config with production to a greater extent.

Re: Fly To Podman: a script that will help you to migrate from Docker

#144

Earlier quoted context omitted.

systemd runs as root yes, but services started by systemd dont unless you instruct them to. that means your podman containers dont run as root unless you want them to. mine runs as user services

I don't see your point. This is exactly how Docker works. Containers that are running when instantiated from the Docker daemon don't need to be run as root. But you can... Just like your containers started from SystemD (quadlet). I run all my containers, when using Docker, as non-root. So where is the upside other than where your trust lies?

> So where is the upside other than where your trust lies?

The upside is political rather than technical, in that Docker signalef multiple times before they happily will pull the rug for developers.

Moving away from that is the driving motivation for using podman. The fact that podman happens to be better engineered is just added bonus.

Re: Fly To Podman: a script that will help you to migrate from Docker

#145
post #92

Earlier quoted context omitted.

podman compose is really bad

Indeed, it has a lot of limitations. It's better to use docker compose with a podman socket.

Interesting; I have yet to run into any issues with it. Teams I work with mostly use it for local development/testing and do actual deploys using Kubernetes, so we don't use Docker Compose for deployments that utilize features unavailable in Podman Compose.

I'll try to do some more testing between the two and edit my original comment with my findings!

Re: Fly To Podman: a script that will help you to migrate from Docker

#146
post #22
post #16

Has Podman become more user friendly in recent years? I gave it a go about three or four years ago now when Docker began their commercial push (which I don't have an issue with). This was for some hobby project, so I didn't spend a ton of time, but it definitely wasn't as set-and-forget as Docker was. I believe I had to set up a separate VM or something? This was on Linux as the host OS too. It's been a while, so apo…

It is not user-friendly, but it works flawlessly once you get used to it. I stayed away from docker all these years and tried podman from scratch last year after docker failed to work for a project I was experimenting with. Took an hour to read various articles and get things working. One thing I liked was it does not need sudo privileges or screw with the networking.

May I ask what issue you ran into with Docker? I'm interested in Podman simply because I'm curious, but I can't think of any reason to move away from Docker besides that.

Re: Fly To Podman: a script that will help you to migrate from Docker

#147
post #101

Earlier quoted context omitted.

How so? What problems do you have with it?

Missing features, lots of debugging spam which cant be turned off, doesnt properly adhere to the compose spec...

Which features specifically? I can't find a conclusive list anywhere. Other than searching GH issues for bugs like: https://github.com/containers/podman-compose/issues/655#issu...

RE debugging spam, the only thing I can think you're referring to can be turned off by setting `export PODMAN_COMPOSE_WARNING_LOGS=false`.

I'm also curious how it doesn't adhere to the spec. I don't doubt you, but it'd be cool if there was a test suite or audit tool that could document that.

Re: Fly To Podman: a script that will help you to migrate from Docker

#148
post #142

Earlier quoted context omitted.

> They're not so different. An environment is just big software. Containers are not a software development platform, but a platform that can be used in the build phase of software development. They are very different. Docker is not inherently a software development platform because it does not provide the tools required to write, compile, or debug code. Instead, Docker is a platform that enables packaging application…

> > They're not so different. An environment is just big software. > Containers are not a software development platform, but a platform that can be used in the build phase of software development. They are very different. Docker is not inherently a software development platform because it does not provide the tools required to write, compile, or debug code. You seem to be arguing about something entirely unrelated. G…

> Why is the port number part of the way you instantiate the container?

Because that’s how networking works in literally every system ever. Containers don’t magically "export" services to the world. They have to bind to a port. That’s how TCP/IP, networking stacks, and every server-client model ever designed functions. Docker is no exception. It has an internal port (inside the container) and an external port (on the host), again, when we're dealing with the default bridge networking. Mapping these is a fundamental requirement for exposing services. Complaining about this is like whining that you have to plug in a power cable to use a computer. Clearly your "expertise" in networking is... Well. Another misunderstanding.

> The tooling should let me wire up a container’s 'http' export to some consumer or to my local port 8000.

Ummmm... It does. It's called: Docker Compose, --network, or service discovery. You can use docker run -p 8000:80 or define a Docker network where containers resolve each other by name. You already don’t have to care about internal ports inside a proper Docker setup.

But you still need to map ports when exposing to the host because… Guess what? Your host machine isn't psychic. It doesn’t magically figure out that some random container process running an HTTP server needs to be accessible on a specific port. That’s why port mapping exists. But you already know this because "you understand TCP and UDP just fine".

> The internal number should be an implementation detail.

This hands-down the dumbest part of the argument. Ports are not just "implementation details." They're literally how services communicate. Inside the container, your app binds to a port (usually one) that it was explicitly configured to use.

If an app inside a container is listening on port 5000, but you want to access it on port 8000, you must declare that mapping (-p 8000:5000). Otherwise, how the hell is Docker (or anyone) supposed to know what port to use? According to you - the software should magically resolve this. And guess what? You don’t have to expose ports if you don’t need to. Just connect containers via a shared network which happens automagically via container name resolution within Docker networking.

Saying ports should be an "implementation detail" is like saying street addresses should be an implementation detail when mailing a letter. You need an address so people know where to send things. I'm sure you get all sorts of riled up when you need to put an address on a blank envelope because the mail should just know... Right? o_O

Re: Fly To Podman: a script that will help you to migrate from Docker

#149
post #92

Earlier quoted context omitted.

podman compose is really bad

Indeed, it has a lot of limitations. It's better to use docker compose with a podman socket.

Or just use docker until podman compose gets fixed.

After all the whole point was supposed to be that it didnt need a daemon.

Re: Fly To Podman: a script that will help you to migrate from Docker

#150
post #142

Earlier quoted context omitted.

> > They're not so different. An environment is just big software. > Containers are not a software development platform, but a platform that can be used in the build phase of software development. They are very different. Docker is not inherently a software development platform because it does not provide the tools required to write, compile, or debug code. You seem to be arguing about something entirely unrelated. G…

> Why is the port number part of the way you instantiate the container? Because that’s how networking works in literally every system ever. Containers don’t magically "export" services to the world. They have to bind to a port. That’s how TCP/IP, networking stacks, and every server-client model ever designed functions. Docker is no exception. It has an internal port (inside the container) and an external port (on the…

I feel like we're talking right past each other or something.

Of course every TCP [0] and UDP networking system ever has port numbers. And basically every CPU has calls functions with numeric addresses. And you plug in power cables to use a computer. Of course Docker containers internally use ports -- if I have a Docker image plus its associated configuration, and I instantiate it as a container, and it uses its internal port 8080 to expose HTTP, then it uses a port number.

But this whole conversation is about Docker's tooling, not about the underlying concept of containers.

And almost every system out there that has decent tooling has abstraction layers to make this nicer. In AT&T assembly language, I can type:

    1:
    ... code goes here
and that code is called "1" in that file and is inaccessible from outside. If I want to call it from outside, I type something more like:

    name_of_function:
    ... code goes here
with maybe a .globl to go along with it. And I call it by typing a name. And that call still calls the numeric address of that function.

If I plug in a power cable to use a computer, I do not plug it into port 3 on the back of the computer, such that accidentally plugging it into port 2 will blow a fuse. I plug it into a port that has a specific shape and possibly a label.

So, yes, I know that "If an app inside a container is listening on port 5000, but you want to access it on port 8000, you must declare that mapping (-p 8000:5000)", but that's not a good thing. Of course, if it's listening on port 5000, I need to map 8000 to 5000. But the fact that I had to type -p 8000:5000 is what's broken. The abstraction layer is missing. That should have been -p 8000:http or something similar.

And the really weird thing is that the team that designed Dockerfile seemed to have an actual inkling that something was needed here, which is why we have:

    EXPOSE 8080
    VOLUME ["/mnt/my_data"]
but they completely missed the variant that would have been good:

    EXPOSE 8080 "rest_http"
    VOLUME "mydata" MANDATORY
    MOUNT_VOLUME "mydata" "/mnt_mydata"
or whatever other spelling of the same concept would have passed muster.

And yes, Docker Compose helps, but that's at the wrong layer. Docker Compose is a consumer of a container image. The mapping from logical exposed service to internal port should have been handled at an abstraction layer below Docker Compose, and Compose and Quadlet and Kubernetes and the command line could all share that abstraction layer.

> ... service discovery. You can use docker run -p 8000:80 or define a Docker network where containers resolve each other by name. You already don’t have to care about internal ports inside a proper Docker setup

Can you point me at some relevant reference? Because, both in my experience and from (re-)reading the basic docs, all of the above is about finding an IP address by which to communicate with a relevant service, not about port numbers, let alone internal port numbers (which are entirely useless to discover from inside another container, because you can't use them there anyway). Even Docker Swarm does things like:

    $ docker service create ... --publish published=8080,target=80
and that's another site, external to the container image in question, where one must type in the correct internal port number.

> I'm sure you get all sorts of riled up when you need to put an address on a blank envelope because the mail should just know... Right? o_O

I will take this the most charitable way I can. Sure, it's mildly annoying that you have to use someone numerical phone number to call them, and we all have contact lists to work around this, but that's still missing the target. I'm not complaining about how you address a docker container, and it makes quite a bit of sense that you need someone's phone number to call them. But if you had to also know that that particular phone you were calling had its microphone on port 83 and you had you tell your phone that their microphone was port 83 if you wanted to hear them and you had to change your contact list if they changed phone models, then I think everyone would be rightly annoyed.

So I stand by my assertion: Docker's tooling is not very good.

[0] But not every networking protocol ever. Even in the space of non-obsolete protocols, IP itself has no port numbers. And the use of a tuple (name or IP, port) is actually a perennial source of annoyance, and people try to improve it periodically, for example with RFC 2782 SRV records and, much more recently, RFC 9460 SVCB and HTTPS records. This is mostly off-topic, as these are about externally visible ports, and I’m talking about internal port numbers.

Post reply on HN