Skip to content

Instantly share code, notes, and snippets.

View khaledalam's full-sized avatar

Khaled Alam khaledalam

View GitHub Profile
#!/usr/bin/env sh
# shellcheck shell=dash
# This script should run in all POSIX environments and Dash is POSIX compliant.
#
# grafanacloud-install.sh installs the Grafana Agent on supported
# Linux systems for Grafana Cloud users. Those who aren't users of Grafana Cloud
# or need to install the Agent on a different architecture or platform should
# try another installation method.
#
function dockerips() {
docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }} => {{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' | sed 's/ \// /'
}