I've a docker container running on my Linux host.
root@eve-ng-6:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ea25d3afa65d ios-xr/xrd-control-plane:latest "/usr/sbin/init" 2 hours ago Up 2 hours 3e2241f3-f914-456a-891f-671c42fafef3-0-5
root@eve-ng-6:~#
root@eve-ng-6:~# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─http-proxy.conf, tcp-sock.conf
Active: active (running) since Thu 2025-05-29 13:12:13 UTC; 3min 54s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 1265607 (dockerd)
Tasks: 19
Memory: 38.5M
CPU: 1.258s
CGroup: /system.slice/docker.service
└─1265607 /usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:4243
root@eve-ng-6:~# ps -ef | grep 1265607
root 1265607 1 0 13:12 ? 00:00:00 /usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:4243
root 1271097 674199 0 13:16 pts/3 00:00:00 grep --color=auto 1265607
root@eve-ng-6:~#
Is there a way to connect to its primary process using an URL like
docker://127.0.0.1:4243/<container id> ? Thanks.
Edit: based on comment received, I'd ask whether it is possible to redirect stdin/stdout of docker attach <> command to a tcp socket. Searching for it I found docker attach
You can't redirect the standard input of a docker attach command while attaching to a TTY-enabled container (using the -i and -t options).
Does this mean that it is actually not feasible to do that ?