Skip to content

Instantly share code, notes, and snippets.


Anthony Lapenna deviantony

Block or report user

Report or block deviantony

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
deviantony /
Last active Sep 3, 2018
Demo multi-cluster DO


These instructions show how to deploy two cluster on Digital Ocean and how to manage them via Portainer.

VM deployment

Deploy 3 nodes on DO:

  1. Click on Create > Droplets
  2. In the image selection, choose "One-click apps"
deviantony /
Last active Mar 13, 2018
Portainer create image from HTTP API

This document aims to help you use the Portainer HTTP API to build a Docker image on a specific environment.


  • A Portainer instance
  • A Portainer user account
  • The environment where you want to build the image created as an endpoint inside the Portainer instance


deviantony /
Created Mar 8, 2018
Portainer admin password in a docker-compose environment

Portainer compose deployment with admin password preset

This file aims to explain how to deploy Portainer inside a compose file with the admin password already set.

Generate the admin password

For this example, we'll use the password superpassword.

Use the following command to generate a hash for the password:

deviantony /
Last active Nov 30, 2017
Swarm aggregation feature discussion

Cluster of agents

This implementation rely on the fact that the agent is able to auto-discover other agents. Deployed as a global service inside a Swarm cluster, each agent automatically discover the other agents in the cluster and register them.

Portainer can then be plugged on any of these agents (either by using DNS-SRV records ensure high-availability or using the URL to a specific agent). To do so, a user would just need to create a new endpoint and add the IP:PORT to one of the agents in the cluster (or use the Swarm service name to be able to use DNS-SRV records).

The agent would be responsible for the following:

  • Aggregate the data of multiple nodes (list the containers available in the cluster for example)
  • Redirect requests to specific nodes in the cluster (inspect a container on a specific node or create a new secret via a cluster manager for example)
deviantony / docker-compose.yml
Created Sep 5, 2017
Docker Swarm cluster setup with Docker in Docker
View docker-compose.yml
version: "2"
image: portainer/portainer:latest
container_name: "portainer-app"
command: -H unix:///var/run/docker.sock
- portainer
- /tmp/manager_run/docker.sock:/var/run/docker.sock
deviantony /
Last active Feb 12, 2020
Portainer HTTP API by example


This document presents a simple way to manage your Docker resource by using Portainer as a gateway (HTTP queries against the Portainer API).

The API documentation is available here:

WARNING: This documentation is valid for Portainer >= 1.18.0.

NOTE: I'm using httpie to execute HTTP queries from the CLI.

deviantony /
Created Jun 23, 2016
Install latest version of Docker Compose
# get latest docker compose released tag
COMPOSE_VERSION=$(curl -s | grep 'tag_name' | cut -d\" -f4)
# Install docker-compose
sh -c "curl -L${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
chmod +x /usr/local/bin/docker-compose
sh -c "curl -L${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
deviantony / prom-node-exporter.service
Created Jun 21, 2016
Systemd script for Prometheus node_exporter
View prom-node-exporter.service
Description=Prometheus node exporter
deviantony /
Last active Jun 21, 2016
Installation of the local-persist volume driver for docker without sudo
#!/usr/bin/env bash
set -e
# uname -s, uname -m
# Deb 32: Linux i686
# Ubuntu 64: Linux x86_64
# FreeBSD: FreeBSD amd64
deviantony / convoy
Created May 6, 2016
Start the convoy daemon using the NFS driver with vfs.path=/var/nfs/volumes
View convoy
# Provides:
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
You can’t perform that action at this time.