This Edge endpoint is associated to an Edge environment.
Edge key: {{ endpoint.EdgeKey }}
Edge identifier: {{ endpoint.EdgeID }}
Deploy the Edge agent on your remote Docker environment using the following command(s)
The agent will communicate with Portainer via {{ edgeKeyDetails.instanceURL }} and tcp://{{ edgeKeyDetails.tunnelServerAddr }}
docker run -d -v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/docker/volumes:/var/lib/docker/volumes \
-v /:/host \
--restart always \
-e EDGE=1 \
-e EDGE_ID={{ randomEdgeID }} \
-e EDGE_KEY={{ endpoint.EdgeKey }} \
-e CAP_HOST_MANAGEMENT=1 \
-v portainer_agent_data:/data \
--name portainer_edge_agent \
portainer/agent
docker network create \
--driver overlay \
portainer_agent_network;
docker service create \
--name portainer_edge_agent \
--network portainer_agent_network \
-e AGENT_CLUSTER_ADDR=tasks.portainer_edge_agent \
-e EDGE=1 \
-e EDGE_ID={{ randomEdgeID }} \
-e EDGE_KEY={{ endpoint.EdgeKey }} \
-e CAP_HOST_MANAGEMENT=1 \
--mode global \
--constraint 'node.platform.os == linux' \
--mount type=bind,src=//var/run/docker.sock,dst=/var/run/docker.sock \
--mount type=bind,src=//var/lib/docker/volumes,dst=/var/lib/docker/volumes \
--mount type=bind,src=//,dst=/host \
--mount type=volume,src=portainer_agent_data,dst=/data \
portainer/agent
For those prestaging the edge agent, use the following join token to associate the Edge agent with this endpoint.
You can read more about pre-staging in the userguide available here.
{{ endpoint.EdgeKey }}