0

Any ideas why nc is not showing anything when ran on a busybox based container image? The problem appears when trying to connect to port on 127.0.0.1/localhost.

/app # nc -v 127.0.0.1 12345
/app # nc -v localhost 12345
/app # nc
BusyBox v1.35.0 (2022-08-01 15:14:44 UTC) multi-call binary.

Usage: nc [OPTIONS] HOST PORT  - connect
nc [OPTIONS] -l -p PORT [HOST] [PORT]  - listen
...

What I would expect is to see if nc has connected or not. On normal Ubuntu the command outputs successful or unsuccessful connections like below. On busybox I don't know what happened because nothing is outputted. enter image description here

nosalan
  • 121
  • 1
  • 3
  • What is running on port 12345? What sort of output do you expect to see? – larsks Sep 05 '22 at 15:57
  • 1
    Many commands in busybox are a pale imitation of the full command/tool they mimic. So I'm not quite sure what you expected to see. – HBruijn Sep 05 '22 at 15:58
  • @larsks I added explanation what I expect: basically I want to simply know if it connected or not? – nosalan Sep 06 '22 at 08:26
  • It looks to me like busybox `nc` returns an error code if it fails to connect. So `nc localhost 12345 || echo FAILED` is maybe what you want. – larsks Sep 06 '22 at 11:57

0 Answers0