Difference between revisions of "Docker ARM Synology"
From Servarr
Line 1: | Line 1: | ||
− | Download | + | Log in as root to your synology. Download and extract the docker binaries by running: |
− | + | curl https://download.docker.com/linux/static/stable/aarch64/docker-20.10.0.tgz | tar -xz -C /usr/local/bin --strip-components=1 | |
− | |||
− | + | Create somewhere for the docker files to live: | |
− | |||
− | |||
− | + | mkdir -p /volume1/@Docker/lib | |
− | + | mkdir /docker | |
+ | mount -o bind "/volume1/@Docker/lib" /docker | ||
+ | Configure docker: | ||
+ | <pre> | ||
+ | mkdir -p /usr/local/etc/ | ||
+ | cat <<EOT >> /usr/local/etc/docker/docker.json | ||
{ | { | ||
"storage-driver": "vfs", | "storage-driver": "vfs", | ||
Line 17: | Line 19: | ||
"data-root": "/docker" | "data-root": "/docker" | ||
} | } | ||
+ | EOT | ||
+ | </pre> | ||
+ | |||
+ | Enable docker to start on boot: | ||
+ | |||
+ | <pre> | ||
+ | cat <<EOT >> /usr/local/etc/rc.d/docker | ||
+ | #!/bin/sh | ||
+ | # Start docker daemon | ||
+ | |||
+ | NAME=dockerd | ||
+ | PIDFILE=/usr/local/var/run/$NAME.pid | ||
+ | DAEMON_ARGS="--config-file=/usr/local/etc/docker/docker.json --pidfile=$PIDFILE" | ||
+ | PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
+ | |||
+ | case "$1" in | ||
+ | start) | ||
+ | echo "Starting docker daemon" | ||
+ | mount -o bind "/volume1/@Docker/lib" /docker | ||
+ | /usr/local/bin/dockerd $DAEMON_ARGS & | ||
+ | ;; | ||
+ | stop) | ||
+ | echo "Stopping docker daemon" | ||
+ | kill $(cat $PIDFILE) | ||
+ | ;; | ||
+ | *) | ||
+ | echo "Usage: "$1" {start|stop}" | ||
+ | exit 1 | ||
+ | esac | ||
+ | exit 0 | ||
+ | |||
+ | Reboot |
Revision as of 14:27, 11 December 2020
Log in as root to your synology. Download and extract the docker binaries by running:
curl https://download.docker.com/linux/static/stable/aarch64/docker-20.10.0.tgz | tar -xz -C /usr/local/bin --strip-components=1
Create somewhere for the docker files to live:
mkdir -p /volume1/@Docker/lib mkdir /docker mount -o bind "/volume1/@Docker/lib" /docker
Configure docker:
mkdir -p /usr/local/etc/ cat <<EOT >> /usr/local/etc/docker/docker.json { "storage-driver": "vfs", "iptables": false, "bridge": "none", "data-root": "/docker" } EOT
Enable docker to start on boot:
cat <<EOT >> /usr/local/etc/rc.d/docker #!/bin/sh # Start docker daemon NAME=dockerd PIDFILE=/usr/local/var/run/$NAME.pid DAEMON_ARGS="--config-file=/usr/local/etc/docker/docker.json --pidfile=$PIDFILE" PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin case "$1" in start) echo "Starting docker daemon" mount -o bind "/volume1/@Docker/lib" /docker /usr/local/bin/dockerd $DAEMON_ARGS & ;; stop) echo "Stopping docker daemon" kill $(cat $PIDFILE) ;; *) echo "Usage: "$1" {start|stop}" exit 1 esac exit 0 Reboot