Open ahmadzeinalwafi opened 1 month ago
Thanks for reporting the issue. The documentation assumes the user has installed the Pipeline plugins (offered through the setup wizard) and the Docker Pipeline plugin
Since you note that you are running from Docker compose
, then the examples that use docker
are not expected to work. When the Jenkins controller is run inside a container, it is generally a bad security practice to allow that controller to start additional containers. The additional instructions added to the page would need to note for users that if they are running the controller inside a container, then they will need to configure one or more agents that are able to run a container.
Description
The official Jenkins documentation provides a pipeline example using agent { docker { image '...' } } on tutorial Using multiple containers Using Docker with Pipeline , but when executed, it fails with the following error:
Steps to Reproduce
Copy and paste the following example into a Jenkins pipeline job:
Run the pipeline
Observe the error message about the invalid agent type docker.
Expected Behavior
The pipeline should execute successfully, pulling the specified Docker images and running the steps within them.
Actual Behavior
Jenkins throws an error indicating that docker is not a valid agent type, suggesting only [any, label, none] are supported.
Environment Details
Jenkins Image Version DockerHub
jenkins/jenkins:lts-jdk17
Docker Plugin Installed
No
Jenkins Running Mode
Docker Compose
Possible Cause
The documentation may be outdated or missing a required plugin. Either the documentation should be corrected, or the error message should provide guidance on the necessary plugin.
Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.
No response
Are you interested in contributing a fix?
No response