Jenkins -> Docker on Agent

Good evening,

I have a Linux server running Jenkins. The jobs are to be executed on a VM that serves as an agent.

My goal is to build a container from an image on the agent (on which Docker is installed) and then execute commands in the container. However, I want to emphasise that I want all of this to be executed in the pipeline on the Jenkins server.

I have of course done some research, but I would like to hear from you how I can best achieve this goal.

Thanks in advance