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.

Yet Another Docker Plugin

dockerShell: [Experimental] Docker Shell Step

  • connector (optional)
      Nested Choice of Objects
    • $class: 'CloudNameDockerConnector'
      • cloudName : String
    • $class: 'DockerConnector'
      • serverUrl : String
        The URL to use to access your Docker server API (e.g: http://172.16.42.43:4243 or unix://).
      • apiVersion : String (optional)
        Docker Daemon API version. Should be set when plugin underlying library can't connect to new daemon because docker daemon API become backward incompatible.
        Version in format "1.22". Connector will append "/v${VERSION}" to api url for connector, where ${VERSION} is entered string. For details see docker_remote_api
      • connectTimeout : int (optional)
        Connection timeout in milliseconds. Use 0 for an unlimited timeout.
      • connectorType (optional)
        Docker-java provides different connection implementations based on different client libraries. In case you have some errors please try other.
        • Values: JERSEY, NETTY, OKHTTP, HTTPCLIENT5
      • credentialsId : String (optional)
      • readTimeout : int (optional)
        Read timeout in milliseconds. Use 0 for an unlimited timeout.
  • containerLifecycle (optional)
      Nested Object
    • createContainer (optional)
        Nested Object
      • bindAllPorts : boolean (optional)
      • bindPorts : String (optional)
        Bind ports from inside the container to outside of the host, scheme is hostport:containerport. Same effect as the "-p" or "-P" option on the CLI. Docker documentation
      • command : String (optional)
        The command to run for this image, replaced by Jenkins Launchers
      • connectNetworks : String (optional)
        Enter existing network names or IDs on separate lines or separated by commas. The plugin connects the container to these networks after creating it, before starting it. For example, set Network Mode to bridge and enter special_net here.
      • cpuShares : int (optional)
        Similarly the operator can increase the priority of this container. By default (no value), all containers run at the same priority and get the same proportion of CPU cycles, but you can tell the kernel to give more shares of CPU time to one or more containers when you start them via Docker.

        Consult https://docs.docker.com/engine/reference/run/#cpu-share-constraint for further information.
      • cpus : String (optional)
      • cpusetCpus : String (optional)
      • cpusetMems : String (optional)
      • devicesString : String (optional)
        Add host device to container. For format please refer to Add host device to container (--device) documentation
      • dnsString : String (optional)
        Set the DNS servers to use within your images, if not set Docker will use DNS settings of the host
      • dockerLabelsString : String (optional)
      • entrypoint : String (optional)
      • environmentString : String (optional)
      • extraHostsString : String (optional)
        A list of new line separated hostnames/IP mappings to be added to the container’s /etc/hosts file. Specified in the form "hostname:IP".
      • hostname : String (optional)
      • linksString : String (optional)
        Add link to another container. Only the form container:alias is supported (e.g. the_db_container:db).
        Consult https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/#communication-across-links for further information.
      • macAddress : String (optional)
        Container MAC address (e.g. 92:d0:c6:0a:29:33)
      • memoryLimit : long (optional)
        The operator can constrain the memory available to a container. If the host supports swap memory, then the setting can be larger than physical RAM.

        Consult Docker Run Documentation for further information.
      • networkMode : String (optional)
        Set the Network mode for the container:
        • Empty: undefined, docker daemon defaults
        • 'bridge': creates a new network stack for the container on the docker bridge
        • 'none': no networking for this container
        • 'container:<name | id>': reuses another container network stack
        • 'host': use the host network stack inside the container. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.
      • privileged : boolean (optional)
      • restartPolicy (optional)
          Nested Object
        • policyName
          • Values: NO, UNLESS_STOPPED, ALWAYS, ON_FAILURE
        • maximumRetryCount : int
      • securityOptsString : String (optional)
        Enter one Docker security option per line. For a Windows gMSA credential specification, enter credentialspec=file://domain_gmsa-group.json. The credential specification file must be available on the Docker host. Omit the --security-opt flag.
      • shmSize : long (optional)
      • storageOptsString : String (optional)
        Enter one Docker storage option per line in key=value format, such as size=50GB. These options correspond to Docker's --storage-opt flag. Supported options depend on the Docker host's storage driver.
      • tmpfsMounts : String (optional)
        Mount temporary filesystems in a Linux container. Enter one absolute container path per line, optionally followed by a colon and comma-separated mount options. For example, /run uses Docker's defaults and /run/lock:size=64m,mode=1777 sets a size and permissions. This is equivalent to Docker's --tmpfs flag.
      • tty : boolean (optional)
      • user : String (optional)
      • volumesFromString : String (optional)
        New line separated list of volumes to inherit from another container. Specified in the form <container name>[:<ro|rw>]
        If accessmode not specified, then default rw will be used.
      • volumesString : String (optional)
        New line separated list of host volume mounts : <host/path>[<container/path>[<:mode>]]
        • container/path create empty volume container/path
        • host/path:container/path will mount host/path from host to container's container/path, read/write
        • host/path:container/path:rw will mount host/path from host to container's container/path, read/write
        • host/path:container/path:ro will mount host/path from host to container's container/path, read-only
        Note: if access mode not specified, then default rw will be used.
      • workdir : String (optional)
    • image : String (optional)
      The hash or tagged name of the image that you wish docker to run (e.g "docker run -i -t /bin/bash")
    • pullImage (optional)
        Nested Object
      • connector (optional)
          Nested Choice of Objects
        • $class: 'CloudNameDockerConnector'
          • cloudName : String
        • $class: 'DockerConnector'
          • serverUrl : String
            The URL to use to access your Docker server API (e.g: http://172.16.42.43:4243 or unix://).
          • apiVersion : String (optional)
            Docker Daemon API version. Should be set when plugin underlying library can't connect to new daemon because docker daemon API become backward incompatible.
            Version in format "1.22". Connector will append "/v${VERSION}" to api url for connector, where ${VERSION} is entered string. For details see docker_remote_api
          • connectTimeout : int (optional)
            Connection timeout in milliseconds. Use 0 for an unlimited timeout.
          • connectorType (optional)
            Docker-java provides different connection implementations based on different client libraries. In case you have some errors please try other.
            • Values: JERSEY, NETTY, OKHTTP, HTTPCLIENT5
          • credentialsId : String (optional)
          • readTimeout : int (optional)
            Read timeout in milliseconds. Use 0 for an unlimited timeout.
      • credentialsId : String (optional)
        Credentials for pulling docker image. Supported only "Docker Registry Auth" type.
      • pullStrategy (optional)
        • Values: PULL_ALWAYS, PULL_ONCE, PULL_LATEST, PULL_NEVER
      • registriesCreds (optional)
          Array / List of Nested Object
        • registryAddr : String
        • credentialsId : String
    • removeContainer (optional)
        Nested Object
      • force : boolean (optional)
        Force the removal of a running container (uses SIGKILL)
      • removeVolumes : boolean (optional)
        Remove the volumes associated with the container
    • stopContainer (optional)
        Nested Object
      • connector (optional)
          Nested Choice of Objects
        • $class: 'CloudNameDockerConnector'
          • cloudName : String
        • $class: 'DockerConnector'
          • serverUrl : String
            The URL to use to access your Docker server API (e.g: http://172.16.42.43:4243 or unix://).
          • apiVersion : String (optional)
            Docker Daemon API version. Should be set when plugin underlying library can't connect to new daemon because docker daemon API become backward incompatible.
            Version in format "1.22". Connector will append "/v${VERSION}" to api url for connector, where ${VERSION} is entered string. For details see docker_remote_api
          • connectTimeout : int (optional)
            Connection timeout in milliseconds. Use 0 for an unlimited timeout.
          • connectorType (optional)
            Docker-java provides different connection implementations based on different client libraries. In case you have some errors please try other.
            • Values: JERSEY, NETTY, OKHTTP, HTTPCLIENT5
          • credentialsId : String (optional)
          • readTimeout : int (optional)
            Read timeout in milliseconds. Use 0 for an unlimited timeout.
      • timeout : int (optional)
        Sending SIGTERM and then SIGKILL after a grace period
  • executorScript : String (optional)
  • longConnector (optional)
      Nested Choice of Objects
    • $class: 'CloudNameDockerConnector'
      • cloudName : String
    • $class: 'DockerConnector'
      • serverUrl : String
        The URL to use to access your Docker server API (e.g: http://172.16.42.43:4243 or unix://).
      • apiVersion : String (optional)
        Docker Daemon API version. Should be set when plugin underlying library can't connect to new daemon because docker daemon API become backward incompatible.
        Version in format "1.22". Connector will append "/v${VERSION}" to api url for connector, where ${VERSION} is entered string. For details see docker_remote_api
      • connectTimeout : int (optional)
        Connection timeout in milliseconds. Use 0 for an unlimited timeout.
      • connectorType (optional)
        Docker-java provides different connection implementations based on different client libraries. In case you have some errors please try other.
        • Values: JERSEY, NETTY, OKHTTP, HTTPCLIENT5
      • credentialsId : String (optional)
      • readTimeout : int (optional)
        Read timeout in milliseconds. Use 0 for an unlimited timeout.
  • shellScript : String (optional)

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.