4 ms·
Podman works with docker-compose 1.x only and needs some finagling to work. I have this wrapper script as podman-compose #!/bin/bash set -e
by amarshall 5y ago
Podman works with docker-compose 1.x only and needs some finagling to work. I have this wrapper script as podman-compose
#!/bin/bash
set -e
tmpdir=$(mktemp -d)
port=$(podman system connection ls | grep -Eo 'localhost:\d+' | head -1 | cut -d: -f2)
[[ -n $port ]] || exit 1
ssh -fnNT -L"$tmpdir/podman.sock":/run/user/1000/podman/podman.sock -i ~/.ssh/podman-machine-default ssh://core@localhost:"$port" -o StreamLocalBindUnlink=yes
export DOCKER_HOST="unix:///$tmpdir/podman.sock"
docker-compose "$@"
rm -r "$tmpdir"
- matsemann 5y agoAfaik podman-compose doesn't support "docker compose run" to do one-off stuff in a new container? Is there some alternative? I do it all the time now, have the entire dev flow dockerized. So I run tests, lints, fixers, migration etc all through docker compose.
- amarshall 5y agoTo be clear: this isn’t the actual podman-compose project, just a wrapper to make docker-compose work with podman-machine. That said, I just tried to do a run and it didn’t work. It’s not part of my workflow though so I haven’t encountered it before and thus haven’t really looked into it.
- MonaroVXR 5y ago> Afaik podman-compose doesn't support "docker compose run" to do one-off stuff in a new container? Is there some alternative? Minikube, no sarcasm. I'm also going to use Minikube.
- ravenstine 5y agoThis is exactly why I ditched Podman. I really wanted to use it badly, but lacking an alternative to Docker Compose or compatibility with it in 2022 is unacceptable. Yes, there is technically a way you can orchestrate containers through configuration, and I don't remember what it was called, but I found it both difficult to use and learn. It's crazy to me that people wanted to develop an alternative to Docker... without a way to just configure and network containers with YAML or JSON.
- amarshall 5y agoThere are use-cases that Podman can be used for that don’t involve Compose (yes, even with orchestration). Likewise there are a lot of features Podman and family have that Docker does not. Historically rootless is the big one; Docker sort of has that now but it’s still not daemon-less.
- hda111 5y agoWhat problems did you have running Docker-compose with podman? I am running both on a server without any problem. Fedora-like distros have a package podman-docker that make docker-compose work without workarounds.
- als0 5y agoIs this a short term issue or is nobody working on docker-compose 3.x compatibility?
- amarshall 5y agoI assume you meant 2.x; Compose 2.x is only ~4 months old. I believe the intention of the Podman team is to abandon their podman-compose and work on compatibility with docker-compose 2.x going forward.
- Macha 5y agoThe version of the file format is different to the version of the CLI tool. Compose (the file format) 3.x was introduced with Compose (the tool) version 1.10 in 2017: https://github.com/docker/compose/releases/tag/1.10.0 https://github.com/docker/compose/releases/tag/1.10.0
- amarshall 5y agoOh. I was only talking about the program and the interface it uses with the underlying runtime. Compose 2.x expects the underlying tool to have a different API.