Live data from Hacker News

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

github.com

131–140 of 152 posts

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

#131

I can't use podman until they start releasing up to date packages for all systems I use. Have they started releasing packages yet?

They offer packages but if you're on a point release distro you'll want to build it from source.

On my Debian box, I build the podman release target in a chroot, extract the archive in /opt/, and use stow to install/uninstall the package. You'll also want the latest crun, but which I also place in stow and install with stow.

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

#132
post #36

Earlier quoted context omitted.

That's a pretty cool migration story! I've been meaning to give podman a more serious look. The OCI image format issue is good to know about – hadn't considered that compatibility angle. I'm curious, did you notice any performance differences in your CI builds after switching?

Its been a while, so all my telemetry has since expired, but there was no meaningful difference in time. I was prepared to roll it all back, but I never ended up running into problems with it. It's just something that happens in the background that I don't have to think about.

Yea, I was under the impression docker uses OCI containers these days and not their own custom definition. But I may be ill-informed.

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

#133
post #48

Earlier quoted context omitted.

It's almost a perfect drop-in replacement for Docker so I don't see why it would be any less "set-and-forget". I only ever found one thing that didn't work with it at all - I think it was Gitlab's test docker images because they set up some VMs with Vagrant or something. Pretty niche anyway.

I could not get LocalStack to work on Podman, to my chagrin. And no, doing the "sudo touch /etc/containers/nodocker" thing didn't solve it.

  podman version
  podman pull public.ecr.aws/localstack/localstack:4.1
  podman run --detach --name lstack -p 4566:4566 public.ecr.aws/localstack/localstack:4.1
  # sorry, I don't have awscli handy
  export AWS_DEFAULT_REGION=us-east-1 AWS_ACCESS_KEY_ID=alpha AWS_SECRET_ACCESS_KEY=beta
  $HOMEBREW_PREFIX/opt/ansible/libexec/bin/python -c '
    import boto3
    sts = boto3.client("sts", endpoint_url="http://localhost:4566")
    print(sts.get_caller_identity())
    '
  {'UserId': 'AKIAIOSFODNN7EXAMPLE', 'Account': '000000000000', 'Arn': 'arn:aws:iam::000000000000:root', ...

I'll spare you the verbosity but

  2025-02-22T18:51:56.427  INFO --- [et.reactor-0] localstack.request.aws     : AWS s3.CreateBucket => 200
  2025-02-22T18:52:14.332  INFO --- [et.reactor-0] localstack.request.aws     : AWS s3.PutObject => 200

  cat > sample-stack.yaml  200
---

ed: ah, I bet you mean the lambda support; FWIW they do call out explicit support for Podman[1] but in my specific setup I had to switch it to use -e DOCKER_HOST=tcp://${my_vm_ip}:2375 and then $(podman system service tcp://0.0.0.0:2375) in the lima vm due to the podman.sock being chown to my macOS UID. My life experience is that engineering is filled with this kind of shit

I used https://github.com/aws-samples/aws-cloudformation-inline-pyt... to end-to-end test it

1: https://github.com/localstack/localstack/blob/v4.1.1/localst...

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

#134
post #130

Earlier quoted context omitted.

Curious what your point is? > I can name many things I do not like about is, and I struggle to find things I like about it’s tooling. Please share.

Off the top of my head: FROM [foo]: [foo] is a reference that is generally not namespaced (ubuntu is relative to some registry, but it doesn't say which one) and it's expected to be mutable (ubuntu:latest today is not the same as ubuntu:latest tomorrow). There are no lockfiles to pin and commit dependency versions. Builds are non-reproducible by default. Every default represents worst practices, not best practices. C…

> 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.

> Why on Earth does copying in data require spinning up a container?

It doesn't.

> Containers are read-write by default, not read-only.

I don't think you really understand containers since COW is the default. Containers are not "read-write" by default in the context of the underlying image. If you want to block writing to the file system that is trivial.

> Things that are logically imports and exports do not have descriptive names. So your container doesn't expose a web service called 'API'; it exposes port 8000. And you need to remember it, and if the image changes the port, you lose, and there is no good way for the tooling to help. Similarly, volumes need to be bound to paths, and there is nothing resembling an interface definition to help get it right. And, since containers are read-write by default, typoing a mount path results in an apparently working container that loses data.

Almost all of this is wrong.

> And the compose files and quadlets are, of course, not really compatible with each other, nor are they compatible with Kubernetes without pulling teeth.

What? This gets wilder as you go on. Why would you expect compose files to be "compatible" with k8s? They are two different ways to orchestrate containers.

Pretty much everything you've outlined is, as I see it, a misunderstanding of what containers aim to solve and how they're operationalized. If all of these things were true container usage, in general, wouldn't have been adopted to the point where it's as commonplace as it is today.

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

#135
On the off chance it matters to anyone, brew whines that podman requires macOS 13.x due to https://github.com/containers/podman/issues/22121 but that's only for $(podman machine start) support, which relies on https://github.com/crc-org/vfkit/issues/37

If you already have colima lying around, that means you have lima and lima ships with both podman and podman-rootful templates:

  limactl create --name=proot template://podman-rootful --vm-type=qemu --cpus=4 --memory 4 --disk 20
  # it will emit the instructions at the end, but for context
  podman system connection add lima-proot "unix:///$HOME/.lima/proot/sock/podman.sock"
  podman system connection default lima-proot
  podman version # 

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

#136

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?

From a technical perspective the big two are:

- Pod is significantly simpler than Docker, notably Podman doesn't need to run a background process, your containers run directly as separate processes.

- Podman avoids some long-standing security design weaknesses in Docker ("rootless"). Docker rootless _is_ a thing but has compatibility limits.

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

#137

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.

Until it’s supported by AWS ECS it’s not relevant for me since that’s what my container builds are for.

Images built by Podman can be run by Docker and vice versa.

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

#138
post #130

Earlier quoted context omitted.

Off the top of my head: FROM [foo]: [foo] is a reference that is generally not namespaced (ubuntu is relative to some registry, but it doesn't say which one) and it's expected to be mutable (ubuntu:latest today is not the same as ubuntu:latest tomorrow). There are no lockfiles to pin and commit dependency versions. Builds are non-reproducible by default. Every default represents worst practices, not best practices. C…

> 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. > Why on Earth does copying in data require spinning up a container? It doesn't. > Containers are read-wri…

>> 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 building large environments for decades, e.g. rpmbuild, nix, Gentoo, whatever Debian's build system is called, etc. And, as far as I know, all of these have each layer explicitly declare what it is mutating; all of them track the input dependencies for each layer; and most or all of them block network access in build steps; some of them try to make layer builds explicitly reproducible. And software build systems (make, waf, npm, etc) have rather similar properties. And then there's Docker, which does none of these.

> > Containers are read-write by default, not read-only.

> I don't think you really understand containers since COW is the default. Containers are not "read-write" by default in the context of the underlying image. If you want to block writing to the file system that is trivial.

Right. The issue is that the default is wrong. In a container:

    $ echo foo >the_wrong_path
works, by default, using COW. No error. And the result is even kind of persistent -- it lasts until the "container" goes away, which can often mean "exactly until you try to update your image". And then you lose data.

> > Things that are logically imports and exports do not have descriptive names. So your container doesn't expose a web service called 'API'; it exposes port 8000. And you need to remember it, and if the image changes the port, you lose, and there is no good way for the tooling to help. Similarly, volumes need to be bound to paths, and there is nothing resembling an interface definition to help get it right. And, since containers are read-write by default, typoing a mount path results in an apparently working container that loses data.

> Almost all of this is wrong.

I would really like to believe you. I would love for Docker to work better, and I tried to believe you, and I looked up best practices from the horse's mouth:

https://docs.docker.com/get-started/docker-concepts/running-...

and

https://docs.docker.com/get-started/docker-concepts/running-...

Look, in every programming language and environmnt I've ever used, even assembly, an interface has a name. If I write a function, it looks like this:

    void do_thing();
If I write an HTTP API, it has a name, like GET /name_goes_here. If I write a class or interface or trait, its methods have names. ELF files expose symbols by name. Windows IIRC has a weird old system for exporting symbols by ordinal, but it’s problematic and largely unused. But Docker images expose their APIs (ports) by number. The welcome-to-docker container has an interface called '8080'. Thanks.

At least the docs try to remind people that the whole mechanism is "insecure by default".

I even tried asking a fancy LLM how to export a port by name, and LLM (as expected) went into full obsequious mode, told me it's possible, gave me examples that don't do it, told me that Docker Compose can do it, and finally admitted the actual answer: "However, it's important to note that the OCI image specification itself (like in a Dockerfile) doesn't have a direct mechanism for naming ports."

> > And the compose files and quadlets are, of course, not really compatible with each other, nor are they compatible with Kubernetes without pulling teeth.

> What? This gets wilder as you go on. Why would you expect compose files to be "compatible" with k8s? They are two different ways to orchestrate containers.

I'd like to have some way for a developer to declare that their software can be run with the 'app' container and a 'mysql' container and you connect them like so. Or even that it's just one container image and it needs the following volumes bound in. And you could actually wire them up with different orchestration systems, and the systems could all read that metadata and help do the right thing. But no, no such metadata exists in an orchestration-system-agnostic way.

> If all of these things were true container usage, in general, wouldn't have been adopted to the point where it's as commonplace as it is today.

Software doesn't look like this. Consider git: it has near universal adoption, but there is a very strong consensus in the community that many of the original CLI commands are really bad.

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

#139
post #92
post #78

Protip: if you want to use Podman (or Podman Desktop) with Docker Compose compatibility, you'll have a better time installing podman-compose [1] and setting up your env like so: alias docker=podman # If you want to still use Docker Compose # export PODMAN_COMPOSE_PROVIDER=docker-compose # On macOS: `brew install podman-compose` export PODMAN_COMPOSE_PROVIDER=podman-compose export PODMAN_COMPOSE_WARNING_LOGS=false Mos…

podman compose is really bad

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

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

#140
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. > Why on Earth does copying in data require spinning up a container? It doesn't. > Containers are read-wri…

>> 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 applications and their dependencies into lightweight, portable containers. These containers can be used in various stages of the software development lifecycle but are not the development environment themselves. This is not just "big software" - which makes absolutely no sense.

> Right. The issue is that the default is wrong. In a container: $ echo foo >the_wrong_path

Can you do incorrect things in software development? Yes. Can you do incorrect things is containers? Yes. You're doing it wrong. If you are writing to a part of the filesystem that is not mounted outside of the container, yes, you will lose your data. Everyone using containers knows this and there are plenty of ways around it. I guess in your case you just always need to export the root of the filesystem so you don't foot gun yourself? I mean c'mon man. It sounds like you'd like to live in a software bubble to protect you from yourself at this point.

> If I write an HTTP API, it has a name, like GET /name_goes_here. If I write a class or interface or trait, its methods have names. ELF files expose symbols by name. Windows IIRC has a weird old system for exporting symbols by ordinal, but it’s problematic and largely unused. But Docker images expose their APIs (ports) by number. The welcome-to-docker container has an interface called '8080'. Thanks.

You clearly don't understand Docker networking. What you're describing is the default bridge. There are other ways to use networking in Docker outside of the default. In your case, again, maybe just run your containers in "host" networking mode because, again, you're too ignorant to read and understand the documentation of why you have to deal with a port mapping in a container that's sitting behind a bridge network. Again you're making up arguments and literally have no clue what you're talking about.

> Software doesn't look like this. Consider git: it has near universal adoption, but there is a very strong consensus in the community that many of the original CLI commands are really bad.

OK? Grab a dictionary - read the definition for the word: "subjective", enjoy!

Post reply on HN