Last active
February 2, 2017 20:06
-
-
Save szukalski/eb2744aaedc4e5f62684ee0437acee26 to your computer and use it in GitHub Desktop.
docker: grafana_install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run this as root | |
PERSISTENT_DATA_DIR=/srv/docker | |
IMAGE=grafana/grafana | |
CONTAINER=grafana | |
CONF_CONTAINER=/etc/grafana | |
CONF_HOST=$PERSISTENT_DATA_DIR/$CONTAINER$CONF_CONTAINER | |
DATA_CONTAINER=/var/lib/grafana | |
DATA_HOST=$PERSISTENT_DATA_DIR/$CONTAINER$DATA_CONTAINER | |
ADMIN_PASSWORD=secret | |
# Pull the image | |
docker pull $IMAGE | |
# Create the persistent data volumes | |
mkdir -p $CONF_HOST | |
mkdir -p $DATA_HOST | |
# Run the image | |
docker run -d \ | |
-p 3000:3000 \ | |
-v $CONF_HOST:$CONF_CONTAINER \ | |
-v $DATA_HOST:$DATA_CONTAINER \ | |
--restart always \ | |
--name $CONTAINER \ | |
$IMAGE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment