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)
        Timeout for opening connection to Docker API. 0 is infinity.
        Works only for Jersey.
      • 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
      • credentialsId : String (optional)
      • readTimeout : int (optional)
        Read timeout to Docker API. In seconds. 0 is infinity.
  • 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
      • 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.
      • 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
      • shmSize : long (optional)
      • 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)
            Timeout for opening connection to Docker API. 0 is infinity.
            Works only for Jersey.
          • 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
          • credentialsId : String (optional)
          • readTimeout : int (optional)
            Read timeout to Docker API. In seconds. 0 is infinity.
      • 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)
            Timeout for opening connection to Docker API. 0 is infinity.
            Works only for Jersey.
          • 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
          • credentialsId : String (optional)
          • readTimeout : int (optional)
            Read timeout to Docker API. In seconds. 0 is infinity.
      • 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)
        Timeout for opening connection to Docker API. 0 is infinity.
        Works only for Jersey.
      • 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
      • credentialsId : String (optional)
      • readTimeout : int (optional)
        Read timeout to Docker API. In seconds. 0 is infinity.
  • 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.