podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

Add support for docker-compose file

Open slemeur opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe

Add support for docker-compose file

Describe the solution you'd like

Add support for docker-compose file

Describe alternatives you've considered

No response

Additional context

No response

slemeur avatar Jun 09 '22 10:06 slemeur

I would prefer you add support for kubernetes.YAML file first (as well) for use with podman play kube/podman generate kube.

rhatdan avatar Jun 09 '22 13:06 rhatdan

I can successfully run docker-compose on Fedora, both in terminal and VS Code Command Palette. However, on Windows, I get this error:

Error: Process 'docker context ls --format="{{json .}}"' exited with code 1
Error: 'docker' is not recognized as an internal or external command,
operable program or batch file.

Error: Process 'docker context ls --format="{{json .}}"' exited with code 1
Error: 'docker' is not recognized as an internal or external command,
operable program or batch file.

I need to know how Podman works on Windows. There is a remote vm that Podman connects to and to which it forwards the commands. Right?

Is there a workaround I can use currently to run docker-compose.yaml files with Podman Desktop?

My PD version is: 0.0.202209061634-a1940b7

djnotes avatar Sep 07 '22 14:09 djnotes

you can take a look for now at https://github.com/containers/podman-compose

benoitf avatar Sep 07 '22 14:09 benoitf

I've updated the description with

Add support for docker-compose file:

  • Install compose binary on Windows and macOS
  • Add podman-compose or podman-desktop-compose command setting up environment variables (current socket/machine) before calling compose binary

benoitf avatar Dec 20 '22 15:12 benoitf

So did some troubleshooting because I was curious on how this works and surprisingly, it worked extremely well!

I did:

  1. Install the binary from https://github.com/docker/compose/releases
  2. Used a test docker-compose yaml https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml

First try testing it:

DOCKER_HOST=unix:///var/run/docker.sock docker-compose up

This brings the containers up, but unfortunately gets stuck on "attaching" to the logs. HOWEVER! Everything else seems to work!

To get around, I just used DOCKER_HOST=unix:///var/run/docker.sock docker-compose up -d instead and then checked the logs with DOCKER_HOST=unix:///var/run/docker.sock docker-compose logs

DOCKER_HOST=unix:///var/run/docker.sock docker-compose logs
DOCKER_HOST=unix:///var/run/docker.sock docker-compose down
DOCKER_HOST=unix:///var/run/docker.sock docker-compose up -d
# all work

All of this appears in Podman Desktop absolutely fine as well as on podman ps

cdrage avatar Feb 01 '23 15:02 cdrage

So did some troubleshooting because I was curious on how this works and surprisingly, it worked extremely well!

I did:

  1. Install the binary from https://github.com/docker/compose/releases
  2. Used a test docker-compose yaml https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml

First try testing it:

DOCKER_HOST=unix:///var/run/docker.sock docker-compose up

This brings the containers up, but unfortunately gets stuck on "attaching" to the logs. HOWEVER! Everything else seems to work!

To get around, I just used DOCKER_HOST=unix:///var/run/docker.sock docker-compose up -d instead and then checked the logs with DOCKER_HOST=unix:///var/run/docker.sock docker-compose logs

DOCKER_HOST=unix:///var/run/docker.sock docker-compose logs
DOCKER_HOST=unix:///var/run/docker.sock docker-compose down
DOCKER_HOST=unix:///var/run/docker.sock docker-compose up -d
# all work

All of this appears in Podman Desktop absolutely fine as well as on podman ps

Further troubleshooting:

The containers work (able to access it).

"Podifying" the selected containers which were deployed does not work and results in a DNS issue with trying to communicate between the three

redis-slave-1-podified   | 7:S 01 Feb 07:12:50.947 # Unable to connect to MASTER: No such file or directory
redis-slave-1-podified   | 7:S 01 Feb 07:12:51.994 * Connecting to MASTER redis-master:6379
redis-slave-1-podified   | 7:S 01 Feb 07:12:52.008 # Unable to connect to MASTER: No such file or directory
frontend-1-podified      | �AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.88.0.6. Set the 'ServerName' directive globally to suppress this message
frontend-1-podified      | �AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.88.0.6. Set the 'ServerName' directive globally to suppress this message
frontend-1-podified      | �[Wed Feb 01 07:12:33.460028 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/5.6.20 configured -- resuming normal operations
frontend-1-podified      | [Wed Feb 01 07:12:33.476790 2023] [core:notice] [pid 1] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
redis-master-1-podified  | [1] 01 Feb 07:12:32.239 # Creating Server TCP listening socket *:6379: bind: Address already in use
redis-slave-1-podified   | 7:S 01 Feb 07:12:53.034 * Connecting to MASTER redis-master:6379
redis-slave-1-podified   | 7:S 01 Feb 07:12:53.038 # Unable to connect to MASTER: No such file or directory
redis-slave-1-podified   | 7:S 01 Feb 07:12:54.059 * Connecting to MASTER redis-master:6379
redis-slave-1-podified   | 7:S 01 Feb 07:12:54.070 # Unable to connect to MASTER: No such file or directory

cdrage avatar Feb 01 '23 15:02 cdrage

Could also be relevant to the WordPress community: https://github.com/WordPress/gutenberg/issues/49889 (just submitted)

@slemeur

karstengresch avatar Apr 18 '23 09:04 karstengresch

closing as all tasks have been completed

benoitf avatar Sep 20 '23 07:09 benoitf