Skip to content

Instantly share code, notes, and snippets.

@natewalck
Forked from Jip-Hop/boot.sh
Created June 10, 2021 17:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save natewalck/7faa8638df137c84e46633d2e1913b55 to your computer and use it in GitHub Desktop.
Save natewalck/7faa8638df137c84e46633d2e1913b55 to your computer and use it in GitHub Desktop.
Using Docker on TrueNAS SCALE (no Kubernetes)
#!/usr/bin/env bash
# Using Docker on TrueNAS SCALE (no Kubernetes)
#
# Don't setup Apps via the TrueNAS Web GUI (don't choose a pool for Apps when asked)
# Make a dedicated docker dataset on one of your data pools
# Store this script somewhere else on your pool (not in the Docker dataset)
# Make a daeomon.json file in the same directory with the following contents:
# {"data-root": "/mnt/path/to/desired/docker/dataset/", "exec-opts": ["native.cgroupdriver=cgroupfs"]}
# Then schedule this script to start via System Settings -> Advanced -> Init/Shutdown Scripts -> Add:
# Choose Type: Script and choose this script, choose to run at Pre Init under When
#
# Now install e.g. Portainer to manage your containers
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Setup custom Docker config (overwrite if contents changed due to system update)
cmp --silent "${SCRIPT_DIR}/daemon.json" /etc/docker/daemon.json || echo "Updating Docker config..." && cp "${SCRIPT_DIR}/daemon.json" /etc/docker/daemon.json
echo "Starting Docker"
systemctl start docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment