Skip to content

Latest commit

Β 

History

History
87 lines (64 loc) Β· 3.33 KB

File metadata and controls

87 lines (64 loc) Β· 3.33 KB

πŸ”Œ Resource Documentation: portainer_docker_plugin

portainer_docker_plugin

The portainer_docker_plugin resource allows installation and (optionally) enabling of a Docker plugin on a selected Portainer endpoint. This resource supports passing plugin privileges such as mount, device, capabilities, etc., as well as setting an alias (name) and supplying a X-Registry-Auth header.


πŸ“¦ Example Usage

Install and enable rclone/docker-volume-rclone plugin:

resource "portainer_docker_plugin" "rclone" {
  endpoint_id   = 3
  remote        = "rclone/docker-volume-rclone"
  name          = "rclone"
  enable        = true
  registry_auth = "e30=" # base64-encoded {}

  settings {
    name  = "network"
    value = ["host"]
  }

  settings {
    name  = "mount"
    value = ["/var/lib/docker-plugins/rclone/config"]
  }

  settings {
    name  = "mount"
    value = ["/var/lib/docker-plugins/rclone/cache"]
  }

  settings {
    name  = "device"
    value = ["/dev/fuse"]
  }

  settings {
    name  = "capabilities"
    value = ["CAP_SYS_ADMIN"]
  }
}

βš™οΈ Arguments Reference

Name Type Required Description
endpoint_id int βœ… yes ID of the Portainer endpoint where the plugin will be installed
remote string βœ… yes Plugin image name (e.g., rclone/docker-volume-rclone)
name string 🚫 optional Local alias for the plugin (e.g., rclone)
enable bool 🚫 optional Whether to enable the plugin after installation (default: false)
registry_auth string 🚫 optional Value for the X-Registry-Auth header (default: e30= = {})
settings list(object) 🚫 optional List of objects with name and value defining plugin privileges

πŸ”§ settings block

Name Type Required Description
name string βœ… yes Type of privilege: network, mount, device, capabilities
value list(string) βœ… yes List of values for the given privilege
description string 🚫 optional Optional description (ignored if empty)

πŸ’¨ Lifecycle & Behavior

  • Docker plugins are immutable; Update is not supported.
  • Changing remote, settings, enable, or registry_auth will destroy and re-create the plugin (ForceNew).
  • If enable = true, an additional API request is performed after successful installation: POST /endpoints/{id}/docker/plugins/{name}/enable

πŸ›„ Attributes Reference

Name Description
id Plugin name (e.g., rclone:latest) used as the unique ID