containers / containers/podman-compose

DNS resolution to the container name or service name when a compose is run with root user is not working

Open
#1,245 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

DNS resolution to the container name or service name when a compose is run with root user is not working.

**To Reproduce**

This is the compose file:

```yaml
version: "2"
services:
box1:
image: docker.io/busybox:1.37.0
command: '/bin/sh -c "trap : TERM INT; sleep 9999999999d & wait"'

box2:
image: docker.io/busybox:1.37.0
command: '/bin/sh -c "trap : TERM INT; sleep 9999999999d & wait"'
```

**Expected behavior**

`box1`, `containers_box1_1`, `box2`, `containers_box2_1` are resolvable to the correct IP in each container. It is working like this if I run the same compose with the non-root user.

**Actual behavior**

Only `containers_box1_1` in box1 and `containers_box2_1` in box2 are resolvable.

**Output**

There is `bad address 'containers_box2_1'` for the unsupported DNS references.

**Environment:**
- OS: Linux
- podman version: 4.9.3
- podman compose version: 1.4.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.