In fact, it depends on the environment and the tools you need in your build environment. For example, if you are creating a C project, you will need an image that contains the C compiler, and possibly makeif you use Makefiles. If you create a Java project, you will need the JDK with the Java compiler, and possibly Ant / Maven / Gradle, if you will use them as part of your build.
You can use evarga / jenkins-slave as a good starting point for your slave device.
This image already contains the JDK. If you just need JDK and Maven on your slave, you can create a Docker image with the following Dockerfile:
FROM evarga/jenkins-slave
run apt-get install maven
Docker slave- . Jenkins Build Environment Docker Containers:
, Docker . , Dockerfile, Dockerfiles , , Dockerfiles .