Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman Compose fails to recognise host-gateway #709

Open
SureshGota opened this issue Jun 12, 2023 · 1 comment
Open

Podman Compose fails to recognise host-gateway #709

SureshGota opened this issue Jun 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@SureshGota
Copy link

Describe the bug
I am running podman and podman console on windows 10 machine. I have used my previous docker compose yaml file to run containers using podman compose. However the containers fail to run due to the following error.
Error: invalid IP address in add-host: "host-gateway"
To Reproduce
Steps to reproduce the behavior:

  1. Podman-compose up

please use minimal reproducible example for example give me a small busybox-based compose yaml

version: "3.9"
services:
    configurationsService:
        image: "localhost/configurations-service"
        hostname: configurationsService
        ports:
          - "51000:51000"
        healthcheck:
              test: "curl --fail --silent configurationsService:51000/actuator/health | grep UP || exit 1"
              interval: 20s
              timeout: 5s
              retries: 5
              start_period: 40s
        restart: always
              
    inventoryInfo:
        image: "localhost/inventory-service"
        hostname: inventoryService
        ports:
          - "51005:51005"
        depends_on:
              configurationsService:
                condition: service_healthy
        extra_hosts:
            - "host.docker.internal:host-gateway"  
        restart: always

Expected behavior
Containers should start successfully

Actual behavior
Error: invalid IP address in add-host: "host-gateway

Output

$ podman-compose version
using podman version: 3.4.0
podman-compose version  0.1.7dev
podman --version 
podman version 3.4.0

$ podman-compose up
...

Environment:

  • OS: WSL
  • podman version:
Client:       Podman Engine
Version:      4.5.0
API Version:  4.5.0
Go Version:   go1.19.7
Built:        Fri Apr 14 21:12:56 2023
OS/Arch:      linux/amd64
  • podman compose version: (git hex)
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.5.0
podman-compose version 1.0.6
podman --version
podman version 4.5.0
@SureshGota SureshGota added the bug Something isn't working label Jun 12, 2023
@ssnepenthe
Copy link

It looks like podman automatically maps host.containers.internal to the gateway via /etc/hosts for all containers.

containers/podman#9972

Does it work if you remove the extra_hosts completely from your docker-compose file and use host.containers.internal everywhere you would have otherwise been using host.docker.internal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants