The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Docker plugin

step([$class: 'DockerBuilderControl']): Start/Stop Docker Containers

  • option
      Nested Choice of Objects
    • $class: 'DockerBuilderControlOptionProvisionAndStart'
      • cloudName : String
      • templateId : String
    • $class: 'DockerBuilderControlOptionRun'
      • cloudName : String
      • image : String
      • pullCredentialsId : String
      • dnsString : String
      • network : String
      • dockerCommand : String
      • mountsString : String
      • volumesFrom : String
      • environmentsString : String
      • hostname : String
      • user : String
      • extraGroupsString : String
      • memoryLimit : int
      • memorySwap : int
      • cpus : String
      • cpuPeriod : long
      • cpuQuota : long
      • cpuShares : int
      • shmSize : int
      • bindPorts : String
      • bindAllPorts : boolean
      • privileged : boolean
      • tty : boolean
      • macAddress : String
    • $class: 'DockerBuilderControlOptionStart'
      • cloudName : String
      • containerId : String
    • $class: 'DockerBuilderControlOptionStop'
      • cloudName : String
      • containerId : String
      • remove : boolean
    • $class: 'DockerBuilderControlOptionStopAll'
      • remove : boolean

step([$class: 'DockerBuilderPublisher']): Build / Publish Docker Image

Build step that sends a Dockerfile for building to docker host that used for this build run.
  • dockerFileDirectory : String
  • fromRegistry
      Nested Object
    • url : String
      URL to the Docker registry you are using. May be left blank to use the public DockerHub registry (currently https://index.docker.io/v1/).
    • credentialsId : String
  • cloud : String
    Cloud to do the build on - or, if empty, use the cloud that the build was performed on.
  • tagsString : String
    Repository name (and optionally a tag) to be applied to the resulting image in case of success.
    Multiple entries are permitted if separated by newlines.
    Environment variable substitution is performed on the strings so you can use e.g. ${BUILD_NUMBER} as part of each entry.
    Each entry must be of the form IMAGE[:TAG] as per the docker tag command.
  • pushOnSuccess : boolean
    If enabled (and the docker image builds successfully), the resulting docker image will be pushed to the registry (or registries) specified within the "Image" field.
  • pushCredentialsId : String
    Credentials to push to a private registry.
  • cleanImages : boolean
  • cleanupWithJenkinsJobDelete : boolean
  • buildArgs (optional)

    A map of build-time variables.

    • Type: java.util.Map<java.lang.String, java.lang.String>
  • buildArgsString : String (optional)

    A list of new line separated build-time variables, specified in the form "name=value".

  • noCache : boolean (optional)
    If set, builds the image with --no-cache which disables caching of layers. See the docker build command for more information.
  • pull : boolean (optional)
    If set, builds the image with --pull to pull the latest version of the base image, instead of using the local one. See the docker build command for more information.

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.