Here's the dockerfile that you can use:
FROM jenkins:latest
USER root
RUN apt-get update && apt-get install -y build-essential
USER jenkins
You can then build this image using docker image build command.
docker image build [OPTIONS] PATH | URL of your dockerfile
After building the image, run it using docker run command.