Drone plugins > Docker
docker.svg

Docker

by drone-plugins


The Docker plugin can be used to build and publish images to the Docker registry.

Example

kind: pipeline
name: default

steps:
- name: docker
  image: plugins/docker
  settings:
    username: kevinbacon
    password: pa55word
    repo: foo/bar
    tags:
    - latest
    - main
    ssh-agent-key:
      from_secret: private_key

Properties

  • registry

    stringoptional

    authenticates to this registry

    Default: none

  • username

    stringoptional

    authenticates with this username

    Default: none

  • password

    stringoptional

    authenticates with this password

    Secret recommended

    Default: none

  • repo

    stringoptional

    repository name for the image

    Default: none

  • tags

    arrayoptional

    repository tag(s) for the image

    Default: none

  • secret

    stringoptional

    Use buildkit to pass secrets to the dockerbuild. Eg `id=mysecret,src=secret-file`

    Default: none

  • dockerfile

    stringoptional

    dockerfile to be used

    Default: Dockerfile

  • dry_run

    stringoptional

    boolean if the docker image should not be pushed at the end

    Default: none

  • purge

    booleanoptional

    boolean if cleanup of the docker image should be done at the end

    Default: true

  • context

    stringoptional

    the context path to use, defaults to root of the git repo

    Default: none

  • target

    stringoptional

    the build target to use, must be defined in the docker file

    Default: none

  • force_tag

    booleanoptional

    replace existing matched image tags

    Default: false

  • insecure

    booleanoptional

    enable insecure communication to this registry

    Default: false

  • mirror

    stringoptional

    use a mirror registry instead of pulling images directly from the central Hub

    Default: none

  • bip

    booleanoptional

    use for pass bridge ip

    Default: false

  • custom_dns

    stringoptional

    set custom dns servers for the container

    Default: none

  • custom_dns_search

    stringoptional

    docker daemon dns search domains

    Default: none

  • storage_driver

    stringoptional

    supports `aufs`, `overlay` or `vfs` drivers

    Default: none

  • storage_path

    stringoptional

    docker daemon storage path

    Default: none

  • build_args

    stringoptional

    pass custom arguments to docker build

    Default: none

  • build_args_from_env

    stringoptional

    pass the envvars as custom arguments to docker build

    Default: none

  • auto_tag

    booleanoptional

    generate tag names automatically based on git branch and git tag

    Default: false

  • auto_tag_suffix

    stringoptional

    generate tag names with this suffix

    Default: none

  • debug

    booleanoptional

    launch the docker daemon in verbose debug mode

    Default: false

  • launch_debug

    booleanoptional

    launch the docker daemon in verbose debug mode

    Default: false

  • mtu

    stringoptional

    docker daemon custom mtu setting

    Default: none

  • ipv6

    stringoptional

    docker daemon IPv6 networking

    Default: none

  • experimental

    booleanoptional

    docker daemon Experimental mode

    Default: false

  • daemon_off

    booleanoptional

    don't start the docker daemon

    Default: false

  • cache_from

    stringoptional

    images to consider as cache sources

    Default: none

  • squash

    booleanoptional

    squash the layers at build time

    Default: false

  • pull_image

    booleanoptional

    force pull base image at build time

    Default: false

  • compress

    booleanoptional

    compress the build context using gzip

    Default: false

  • custom_labels

    stringoptional

    additional k=v labels

    Default: none

  • label_schema

    stringoptional

    label-schema labels

    Default: none

  • email

    stringoptional

    docker email

    Default: none

  • no_cache

    stringoptional

    do not use cached intermediate containers

    Default: none

  • add_host

    stringoptional

    additional host:IP mapping

    Default: none

  • platform

    stringoptional

    specify the target platform for the build output, (for example, linux/amd64, linux/arm64, or darwin/amd64).

    Default: none

  • ssh-agent-key

    stringoptional

    private key to use for ssh passthrough, see https://docs.docker.com/engine/reference/commandline/buildx_build/#ssh

    Secret recommended

    Default: none