Hacker News new | ask | show | jobs
by williamsmj 1752 days ago
My understanding is that this old article is no longer the simplest/easiest way of doing this. For that, see https://marcusnoble.co.uk/2021-09-01-migrating-from-docker-t.... tl;dr:

    $ brew install podman
    $ podman machine init
    $ podman machine start
    $ alias docker=podman
If you're on an M1 you may run into https://github.com/containers/podman/issues/10577 (which is WIP, and may have been resolved by https://github.com/containers/podman/pull/11451).
4 comments

Does this actually work for you? I tried it and networking was broken out of the box – it couldn’t even pull a container image. I didn’t have time to spend digging into it, however, and would not rule out that being an artifact of our VPN.
Networking is working just fine over here; I rebuilt the machine to be using the latest (Sept 4) FCOS stream, but it was fine on the previous version (Aug 21) as well.

Are you using short names to pull your images, i.e. 'requarks/wiki:latest' rather than the full path 'docker.io/requarks/wiki:latest'? (Note: official images in Docker Hub are under the 'library/' namespace, e.g. 'library/fedora')

Other networking issues, like the port publishing through the host bridging by default without needing to pass '--network' I believe are slated for the upcoming 3.3.2 patch release.

One issue still apparently is that it can’t mount volumes. Though I haven’t had to do that yet. When you attempt to mount a volume it will attempt to do it from within the virtual machine not your machine.
The issue to watch is here: https://github.com/containers/podman/issues/8016

To be clear volumes are supported, what aren't are "bind mounts" which are not recommended over named volumes: https://docs.docker.com/storage/volumes/ https://docs.docker.com/storage/bind-mounts/

This is a known issue and is in the process of being figure out how to proceed: https://github.com/containers/podman/issues/8016
Good to know - I’ll give it another run when I have more time later this week.
If this is using the macOS native virtualization, then, yes, networking will be broken while a vpn is active.

This is a known issue that also was present in the Docker for Apple Silicon public preview where they eventually fixed it by dropping built-in virtualization for qemu

I think also this podman blog post from a few days ago is relevant: https://podman.io/blogs/2021/09/06/podman-on-macs.html
That tl;dr worked great.

I'll have to see if there's a Nix package for it tomorrow morning for work.

Does this work with compose? Probably not but just wondering
The problem with making this work, IIRC, is that Docker Compose doesn't actually "compose" Docker commands, but instead _re-implements_ a bunch of functionality itself through its Python libraries. So you'd actually need to bring your own CLI-compatible Docker Compose implementation for Podman rather than just making your Docker replacement compatible.
Podman solved this by just re-implementing docker’s socket API (which does mean it now requires a daemon to use compose) https://www.redhat.com/sysadmin/podman-docker-compose
In addition to the sibling comment (which mentions that you can use the original docker-compose) such a CLI-compatible reimplementation also exists [0]. It's not always a 100% drop-in replacement, but gets you pretty far in my experience.

[0] https://github.com/containers/podman-compose

Anecdotally I can say that I ran into issues with fairly simple files (2 years ago). I’m going to try out the alternatives before coming back to this.
It more or less works, at least on Linux.

https://www.redhat.com/sysadmin/podman-docker-compose

podman-compose is a thing but it’s not feature complete.