depending on your image you are using, it may contain a telnet client or not. Most images do not contain telnet clients. But if you are fine with netcat, then use this, because this is more likely to be already installed.
if you insist on telnet and have for example an ubuntu image, then just execute
apt-get update && apt-get install telnet.