Usability of Docker Compose with Podman for remote deployments #29355
shantanoo-desai
started this conversation in
General
Replies: 2 comments
InvestigationsI think a better solution / hack that I found instead of SSH tunneling: Wrapper spoofing: sudo tee /usr/local/bin/docker >/dev/null <<'EOF'
#!/bin/sh
exec podman "$@"
EOF
sudo chmod +x /usr/local/bin/dockerOR sudo ln -s $(which podman) /usr/local/bin/dockerImplementing this on the remote machine works like a charm. |
0 replies
|
I have to use some software that execs to docker under the hood, I use the podman-docker Fedora package and never had any issues, with the caveat I don't think it's doing anything with compose though but assume in practice it would work the same. I think it's just these wrappers on the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Aim
I have been poking around to see if I can leverage
podmanv5.x with the Docker Compose v5.x plugin (not thepodman-composetool).The tool does provide a better Developer Experience (DX) and also supports Init Containers logic (tested locally) which the
podman-composetool doesn't.This discussion goes through a deeper-inspection on what probably a final missing-bit on leveraging the goal of something along the lines of:
Initial Setup
One can easily leverage using the compose plugin with
podmanby doing the following:Simple test:
In order to leverage building a compose application:
systemctl --user enable --now podman.socketon such machines:
works flawlessly.
Experimenting with Remote Connections
Assume the the two identical machines are setup based on the information provided in Initial Setup above.
podmanversionbox-01(Ubuntu)5.7.0box-02(Rocky Linux)5.8.2These boxes are configured to have passwordless SSH login already.
Assume
box-01is a staging server andbox-02is development environment.Setup Connection
on box-01:
sudo systemctl enable --now sshdon box-02:
podman system connection add staging \ --identity ~/.ssh/id_ed25519 \ ssh://laborant@box-01list connection:
remote CLI trials:
Trials and Tribulations with
podman --remote composepodman --remote compose up -dFor the following simple
compose.ymlfile:Trying to perform spews out
dockerrelated errorMakes sense as the compose plugin expects Docker CLI to exist remote (which doesn't)
leveraging
DOCKER_HOSTcompose plugin does recognize
DOCKER_HOSTas seen in the logs above:DOCKER_HOST=$(podman system connection ls -f '{{ .URI }}') podman --remote compose up -dwould result in the same output as above.
Leveraging
DOCKER_HOSTas podman.socket pathWould infact start the Application locally and not remotely:
Only way possible: SSH tunneling
because connecting to remote socket via SSH doesn't work, the only way out is to use:
Deploy the application:
So adding this socket to a connection:
Finally:
This time the deployment actually works and only the remote machine has the deployed container.
Query
Is this the only possible way to leverage remote podman + docker compose plugin?
Or can
podman systemleverage an SSH proxy / tunneling logic to help with the lifecycle of the tunnel?Or is this something that is beyond the realm of Podman and relies on the compose development design?
All reactions