Install hexdump in an Ubuntu Docker image

I am using the ubuntu:16.04 image, but apparently it doesn't have the hexdump package (because some other stuff I do in the image are failing because of it). So, I tried to apt-get install hexdump but got an error E: Unable to locate package hexdump.

When I search for info online it seems like this package should be installed with Ubuntu by default, but maybe in the Docker image it was stripped out. And thus I can't really find sources for how to install it.


hexdump utility is part of bsdmainutils package.

Alternatively, you could use xxd from the xxd package


Add the following command in the Dockerfile of the image:

RUN apt-get install bsdmainutils