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
        • Type: String
    • $class: 'DockerConnector'
      • serverUrl
        The URL to use to access your Docker server API (e.g: http://172.16.42.43:4243 or unix://).
        • Type: String
      • apiVersion (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
        • Type: String
      • connectTimeout (optional)
        Timeout for opening connection to Docker API. 0 is infinity.
        Works only for Jersey.
        • Type: int
      • 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
      • credentialsId (optional)
        • Type: String
      • readTimeout (optional)
        Read timeout to Docker API. In seconds. 0 is infinity.
        • Type: int
  • containerLifecycle (optional)
      Nested Object
    • createContainer (optional)
        Nested Object
      • bindAllPorts (optional)
        • Type: boolean
      • bindPorts (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
        • Type: String
      • command (optional)
        The command to run for this image, replaced by Jenkins Launchers
        • Type: String
      • cpuShares (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.
        • Type: int
      • cpusetCpus (optional)
        • Type: String
      • cpusetMems (optional)
        • Type: String
      • devicesString (optional)
        Add host device to container. For format please refer to Add host device to container (--device) documentation
        • Type: String
      • dnsString (optional)
        Set the DNS servers to use within your images, if not set Docker will use DNS settings of the host
        • Type: String
      • dockerLabelsString (optional)
        • Type: String
      • entrypoint (optional)
        • Type: String
      • environmentString (optional)
        • Type: String
      • extraHostsString (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".
        • Type: String
      • hostname (optional)
        • Type: String
      • linksString (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.
        • Type: String
      • macAddress (optional)
        Container MAC address (e.g. 92:d0:c6:0a:29:33)
        • Type: String
      • memoryLimit (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.
        • Type: long
      • networkMode (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.
        • Type: String
      • privileged (optional)
        • Type: boolean
      • restartPolicy (optional)
          Nested Object
        • policyName
          • Values: NO, UNLESS_STOPPED, ALWAYS, ON_FAILURE
        • maximumRetryCount
          • Type: int
      • shmSize (optional)
        • Type: long
      • tty (optional)
        • Type: boolean
      • user (optional)
        • Type: String
      • volumesFromString (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.
        • Type: String
      • volumesString (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.
        • Type: String
      • workdir (optional)
        • Type: String
    • image (optional)
      The hash or tagged name of the image that you wish docker to run (e.g "docker run -i -t /bin/bash")
      • Type: String
    • pullImage (optional)
        Nested Object
      • credentialsId (optional)
        Credentials for pulling docker image. Supported only "Docker Registry Auth" type.
        • Type: String
      • pullStrategy (optional)
        • Values: PULL_ALWAYS, PULL_ONCE, PULL_LATEST, PULL_NEVER
      • registriesCreds (optional)
          Array/List
          Nested Object
        • registryAddr
          • Type: String
        • credentialsId
          • Type: String
    • removeContainer (optional)
        Nested Object
      • force (optional)
        Force the removal of a running container (uses SIGKILL)
        • Type: boolean
      • removeVolumes (optional)
        Remove the volumes associated with the container
        • Type: boolean
    • stopContainer (optional)
        Nested Object
      • timeout (optional)
        Sending SIGTERM and then SIGKILL after a grace period
        • Type: int
  • executorScript (optional)
    • Type: String
  • shellScript (optional)
    • Type: String

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.