Version 1.0.0
Language EN

drone server env

This subcommand prints environment variables to dictate that docker should run a command against a particular server node.

Example usage:

$ drone server env agent-f0e4c2f7

export DOCKER_TLS=1
export DOCKER_CERT_PATH=/home/octocat/.drone/certs/agent-f0e4c2f7
export DOCKER_HOST=tcp://

# Run this command to configure your shell:
# eval "$(drone server env agent-f0e4c2f7)"

Example shell configuration:

$ eval "$(drone server env agent-f0e4c2f7)"
$ docker version

 Version:	18.03.0-ce
 API version:	1.35 (downgraded from 1.37)
 Go version:	go1.9.4
 Git commit:	c160c73
 Built:	Thu Feb 22 02:34:03 2018
 OS/Arch:	darwin/amd64
 Experimental:	false
 Orchestrator:	swarm

  Version:	17.12.0-ce
  API version:	1.35 (minimum version 1.12)
  Go version:	go1.9.2
  Git commit:	c97c6d6
  Built:	Wed Dec 27 20:09:53 2017
  OS/Arch:	linux/amd64
  Experimental:	false

The example above requires Docker client version 18.03.0 or higher.

Shell Support

The default configuration is intended for bash and zsh. However, Drone support multiple shell environments including bash, powershell, and fish.

For fish shell:

$ drone server env agent-f0e4c2f7 --shell=fish

sex -x DOCKER_TLS "1";
set -x DOCKER_CERT_PATH "/home/octocat/.drone/certs/agent-f0e4c2f7";
set -x DOCKER_HOST tcp://;

# Run this command to configure your shell:
# eval "$(drone server env agent-f0e4c2f7 --shell=fish)"

For powershell:

drone server env agent-f0e4c2f7 --shell=powershell

$Env:DOCKER_TLS = "1"
$Env:DOCKER_CERT_PATH = "/home/octocat/.drone/certs/agent-f0e4c2f7"
$Env:DOCKER_HOST = "tcp://"

# Run this command to configure your shell:
# drone server env agent-f0e4c2f7 --shell=powershell | Invoke-Expression

Getting Help

Enterprise Support
Real-time chat support from the developers that wrote the code.
Start here. It has answers to many common questions.
Table of Contents and Reference
Handy when looking for specific information.
Mailing List
Search for information in the mailing list archives, or post a question.