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

[Bug]: Docker containers cannot refer to one another by name #19129

Closed
ygottlieb-peratonlabs-com opened this issue Feb 1, 2024 · 2 comments
Closed
Assignees
Labels
bug report Something is not working properly

Comments

@ygottlieb-peratonlabs-com

Problem description

Following the Docker network tutorial for user-defined networks does not allow two containers to ping each other by name.

This is caused by the docker/resolvconf.patch that adds @TERMUX_PREFIX@ in moby/container/container_unix.go even though the paths in that file refer to the file system inside the container rather than the one outside of it.

What steps will reproduce the bug?

  1. Install containerd patched as described in [Bug]: docker/containerd #18359 (comment) or [Bug]: docker/containerd #18359 (comment)
  2. Install docker and tsu
    pkg install docker tsu
    
  3. Become root
    sudo bash
    
  4. Start dockerd
    dockerd -G 0 > /dev/null 2>&1 &
    
  5. Create a user-defined network:
    docker network create --driver bridge alpine-net
    
  6. Create a docker container to receive pings
    docker run --name alpine1 --rm -dit --net alpine-net alpine ash
    
  7. Create a docker container to ping alpine1
    docker run --name alpine2 --rm -it --net alpine-net alpine ping -c 2 alpine1
    

The result is

ping: bad address 'alpine1'

Note also that

~ # docker exec alpine1 ls /etc/resolv.conf
ls: /etc/resolv.conf: No such file or directory
~ # docker exec alpine1 cat /data/data/com.termux/files/usr/etc/resolv.conf 
nameserver 127.0.0.11
options ndots:0

What is the expected behavior?

Ping should succeed:

PING alpine1 (172.19.0.2): 56 data bytes
64 bytes from 172.19.0.2: seq=0 ttl=64 time=0.500 ms
64 bytes from 172.19.0.2: seq=1 ttl=64 time=0.542 ms

--- alpine1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
router-trip min/avg/max = 0.500/0.521/0.542 ms

System information

termux-info:

Termux Variables:
unsupported
Packages CPU architecture:
x86_64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main stable main
# root-repo (sources.list.d/root.list)
deb https://packages-cf.termux.dev/apt/termux-root root stable
Updatable packages:
Running as root. Cannot check package updates.
termux-tools version:
1.40.5
Android version:
9
Kernel build information:
Linux phone 4.19.195-android-x86_64-g8a9ae81896cb-dirty #8 SMP PREEMPT Wed Nov 22 20:19:56 UTC 2023 x86_64 Android
Device manufacturer:
QEMU
Device model:
Standard PC (i440FX + PIIX, 1996)
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
@ygottlieb-peratonlabs-com ygottlieb-peratonlabs-com added bug report Something is not working properly untriaged labels Feb 1, 2024
@sylirre sylirre removed the untriaged label Feb 1, 2024
@sylirre sylirre self-assigned this Feb 1, 2024
termux-pacman-bot added a commit to termux-pacman/termux-packages that referenced this issue Feb 1, 2024
@sylirre
Copy link
Member

sylirre commented Feb 1, 2024

Try upgrading docker package now.

@ygottlieb-peratonlabs-com
Copy link
Author

@sylirre
The update works for me. Thank you!

@sylirre sylirre closed this as completed Feb 1, 2024
bigbio2002 pushed a commit to bigbio2002/termux-packages that referenced this issue Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly
Projects
None yet
Development

No branches or pull requests

2 participants