Skip to content

Instantly share code, notes, and snippets.

@bitsandbooks
Last active September 18, 2018 00:02
Show Gist options
  • Save bitsandbooks/5478db696fa0be57935f9b5ec011bcef to your computer and use it in GitHub Desktop.
Save bitsandbooks/5478db696fa0be57935f9b5ec011bcef to your computer and use it in GitHub Desktop.
Update Tautulli Docker Container
#!/bin/sh
# by Rob Dumas
# When Tautulli tells me there's a new version available, I run this
# shell sript to remove the old container and create a new one.
# License: 2-clause BSD
CONTAINER_NAME="mycontainer"
CONTAINER_ID=$(docker ps -aqf "name=$CONTAINER_NAME")
CONTAINER_UID=1000
CONTAINER_GID=2000
CONTAINER_PORT=3000
IPV4_ADDR=$(ip -o -4 addr list enp3s0 | awk '{print $4}' | cut -d/ -f1)
if [ -n "$CONTAINER_ID" ]; then
echo "Deleting container '$CONTAINER_NAME' with id '$CONTAINER_ID'"
docker stop "$CONTAINER_ID"
docker rm "$CONTAINER_ID"
else
echo "Container $CONTAINER_NAME not found. Launching a new container..."
fi
docker image prune -f -a
docker pull tautulli/tautulli
docker run --name="$CONTAINER_NAME" \
--restart always \
-v "/path/to/tautulli/config:/config" \
-v "/path/to/plexlogs:/plex_logs:ro" \
-e PUID="$CONTAINER_UID" \
-e PGID="$CONTAINER_GID" \
-e TZ="America/Chicago" \
-p "$IPV4_ADDR:"$CONTAINER_PORT":8181" \
-d \
tautulli/tautulli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment