Hello!
I have a case where I want to run containers on a certain Docker host, which has been connected to the controller via Docker API setup. I would like to set the hostname of the container using a variable set in the Job Pipeline, which will be a computed string and will change on every new run. I am setting node for the job using the label set in Docker Agent Template:
agent {
label 'my-agent'
}
The only way to set a hostname I found, is through the Container Settings in the Docker Agent Template configuration. But it will assign a fixed hostname to all the containers created.
Is there a way to pass the hostname from Jenkins pipeline?