Install telnet in a (alpine linux) docker container


There are moments where you need to get into your docker container and connect with telnet to a host. But usually alpine docker images don’t have telnet installed. In alpine the alpine package manager – APK – makes the installation for packages easy and is the counterpart of apt.

You will want to install the busybox-extras package – it contains telnet Follow the commands and you will have telnet installed in seconds and can debug all your problems 🙌

host:/# apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
v3.17.5-13-g151bd6f55a2 [https://dl-cdn.alpinelinux.org/alpine/v3.17/main]
v3.17.5-14-g5e93270ae77 [https://dl-cdn.alpinelinux.org/alpine/v3.17/community]
OK: 17821 distinct packages available

host:/# apk add busybox-extras
(1/1) Installing busybox-extras (1.35.0-r29)
Executing busybox-extras-1.35.0-r29.post-install
Executing busybox-1.35.0-r29.trigger
OK: 100 MiB in 102 packages

munin-server:/# telnet 4949