Difference between revisions of "Docker ARM Synology"

From Servarr
m (Bakerboy448 moved page Docker on arm synology to Docker ARM Synology)
(reformat)
Line 1: Line 1:
Log in as root to your synology.  Download and extract the docker binaries by running:
+
# Log in as `root` to your synology.   
 +
# Download and extract the docker binaries by running:
  
 
<pre>
 
<pre>
 
curl https://download.docker.com/linux/static/stable/aarch64/docker-20.10.0.tgz | tar -xz -C /usr/local/bin --strip-components=1
 
curl https://download.docker.com/linux/static/stable/aarch64/docker-20.10.0.tgz | tar -xz -C /usr/local/bin --strip-components=1
 
</pre>
 
</pre>
 
+
# Create somewhere for the docker files to live:
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 /volume1/@Docker/lib  
 
  mkdir /docker  
 
  mount -o bind "/volume1/@Docker/lib" /docker
 
 
 
Configure docker:
 
 
<pre>
 
<pre>
 
mkdir -p /usr/local/etc/docker
 
mkdir -p /usr/local/etc/docker
Line 23: Line 19:
 
EOT
 
EOT
 
</pre>
 
</pre>
 
+
# Enable docker to start on boot:
Enable docker to start on boot:
 
  
 
<pre>
 
<pre>
Line 54: Line 49:
 
chmod 755 /usr/local/etc/rc.d/docker.sh
 
chmod 755 /usr/local/etc/rc.d/docker.sh
 
</pre>
 
</pre>
 
+
# Create the docker group, replacing `MYUSERNAME` with the username you use to log in with SSH
Create the docker group, replacing MYUSERNAME with the username you use to log in with SSH
 
  
 
  synogroup --add docker root MYUSERNAME
 
  synogroup --add docker root MYUSERNAME
  
Start it!
+
# Start it!
  
 
  /usr/local/etc/rc.d/docker.sh start
 
  /usr/local/etc/rc.d/docker.sh start
  
Install docker compose:
+
# Install docker compose:
  
 
<pre>
 
<pre>
Line 70: Line 64:
 
</pre>
 
</pre>
  
Reboot.   
+
# Reboot.   
 
+
# Hopefully you have a functioning `docker` and `docker-compose`
Hopefully you have a functioning `docker` and `docker-compose`
+
# You can start portainer with:
 
+
# docker run --network=host -v "/var/run/docker.sock:/var/run/docker.sock"  portainer/portainer-ce:linux-arm64
You can start portainer with:
+
# Which will start portainer on port 9000 on the host.
docker run --network=host -v "/var/run/docker.sock:/var/run/docker.sock"  portainer/portainer-ce:linux-arm64
 
 
 
Which will start portainer on port 9000 on the host.
 

Revision as of 18:39, 11 December 2020

  1. Log in as `root` to your synology.
  2. 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
  1. Create somewhere for the docker files to live:
  2. mkdir -p /volume1/@Docker/lib mkdir /docker mount -o bind "/volume1/@Docker/lib" /docker
  3. Configure docker:
mkdir -p /usr/local/etc/docker
cat <<EOT > /usr/local/etc/docker/docker.json
{
  "storage-driver": "vfs",
  "iptables": false,
  "bridge": "none",
  "data-root": "/docker"
}
EOT
  1. Enable docker to start on boot:
cat <<'EOT' > /usr/local/etc/rc.d/docker.sh
#!/bin/sh
# Start docker daemon

NAME=dockerd
PIDFILE=/var/run/$NAME.pid
DAEMON_ARGS="--config-file=/usr/local/etc/docker/docker.json --pidfile=$PIDFILE"

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
EOT

chmod 755 /usr/local/etc/rc.d/docker.sh
  1. Create the docker group, replacing `MYUSERNAME` with the username you use to log in with SSH
synogroup --add docker root MYUSERNAME
  1. Start it!
/usr/local/etc/rc.d/docker.sh start
  1. Install docker compose:
curl -L --fail https://gist.githubusercontent.com/ta264/af20c367aafa63795c3104d4b0c8b148/raw/4f6d257c026596cfce1c9052d9ac426a50e9f205/run.sh -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
  1. Reboot.
  2. Hopefully you have a functioning `docker` and `docker-compose`
  3. You can start portainer with:
  4. docker run --network=host -v "/var/run/docker.sock:/var/run/docker.sock" portainer/portainer-ce:linux-arm64
  5. Which will start portainer on port 9000 on the host.