All Projects → markdumay → synology-docker

markdumay / synology-docker

Licence: MIT license
An Unofficial Script to Update or Restore Docker Engine and Docker Compose on Synology

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to synology-docker

Synology
Cheatsheet and bash scripts sripts for Synology Nas Stations cheet cheat sheet nas networkdisk
Stars: ✭ 125 (-3.85%)
Mutual labels:  synology
qb-rss-manager
qBittorrent rss订阅规则管理, 支持Docker环境, 群晖, Windows桌面, Linux桌面的qb. 推荐直接使用懒人包体验完整功能.
Stars: ✭ 134 (+3.08%)
Mutual labels:  synology
synology-decrypt
An open source implementation/description of the Synology Cloud Sync encryption/decryption algorithm
Stars: ✭ 91 (-30%)
Mutual labels:  synology
Synology Download Manager
An open source browser extension for adding/managing download tasks to your Synology DiskStation.
Stars: ✭ 138 (+6.15%)
Mutual labels:  synology
Synologycloudflareddns
📜 Cloudflare DDNS script for Synology
Stars: ✭ 222 (+70.77%)
Mutual labels:  synology
synologylyric
Collection of Synology Audio Station Lyrics Module
Stars: ✭ 61 (-53.08%)
Mutual labels:  synology
Synologyddnscloudflaremultidomain
Synology DDNS Cloudflare service provider with multidomains and subdomains
Stars: ✭ 51 (-60.77%)
Mutual labels:  synology
synology-open-vm-tools
VMware Tools for Synology DSM
Stars: ✭ 93 (-28.46%)
Mutual labels:  synology
cloudflareddns
DDNS with Cloudflare
Stars: ✭ 33 (-74.62%)
Mutual labels:  synology
synology-api
A Python wrapper around Synology API
Stars: ✭ 116 (-10.77%)
Mutual labels:  synology
Photostation Upload Lr Plugin
Photo StatLr (aka PhotoStation Upload) is a Lightroom Publish and Export Service Plugin that enables the export /publishing of photos and videos from Lr to a Synology Photo Station. It uploads the photos/videos and all required thumbnails. It can download comments and ratings and do a real two-way synch of various metadata (tags, ratings, labels).
Stars: ✭ 159 (+22.31%)
Mutual labels:  synology
Pyload
The free and open-source Download Manager written in pure Python
Stars: ✭ 2,393 (+1740.77%)
Mutual labels:  synology
Synology-NAS-monitoring
influxDB, Grafana, snmp and telegraf
Stars: ✭ 140 (+7.69%)
Mutual labels:  synology
Scripts
This project attempts to improve DSM's compatibility
Stars: ✭ 130 (+0%)
Mutual labels:  synology
synology
My Synology automation scripts. Making Synology NAS command line usable
Stars: ✭ 45 (-65.38%)
Mutual labels:  synology
Airconnect Synology
AirConnect package for Synology NAS and Synology Router
Stars: ✭ 102 (-21.54%)
Mutual labels:  synology
Home-Assistant Config
BeardedTinker Home Assistant configuration. Feel free to browse, edit, tweak, improve, criticize and suggest.
Stars: ✭ 241 (+85.38%)
Mutual labels:  synology
synology-csi
Container Storage Interface (CSI) for Synology
Stars: ✭ 136 (+4.62%)
Mutual labels:  synology
AirConnect-Synology
Updated AirConnect packages for Synology NAS and Synology Router
Stars: ✭ 200 (+53.85%)
Mutual labels:  synology
flickr-uploader
Upload a directory of media to Flickr to use as a backup to your local storage
Stars: ✭ 38 (-70.77%)
Mutual labels:  synology

synology-docker

An Unofficial Script to Update or Restore Docker Engine and Docker Compose on Synology NAS

AboutBuilt WithPrerequisitesDeploymentUsageContributingCreditsDonateLicense

About

⚠️ The repository 'Synology-Docker' is not supported by Synology and can potentially lead to malfunctioning of your NAS. Use this script at your own risk. Please keep a backup of your files.

Synology is a popular manufacturer of Network Attached Storage (NAS) devices. It provides a web-based user interface called Disk Station Manager (DSM). Synology also supports Docker on selected models. Docker is a lightweight virtualization application that gives you the ability to run containers directly on your NAS. The add-on package provided by Synology to install Docker is typically a version behind on the latest available version from Docker. Synology-Docker is a POSIX-compliant shell script to update both the Docker Engine and Docker Compose on your NAS to the latest version or a specified version.

Built With

The project uses Docker, a lightweight virtualization application.

Prerequisites

Synology-Docker runs on a Synology NAS with DSM 6 or DSM 7. The script has been tested with a DS918+ running DSM 6.2.4-25556 and DSM 7.0.1-42218. Other prerequisites are:

  • SSH admin access is required - Synology-Docker runs as a shell script on the terminal. You can enable SSH access in DSM under Control Panel ➡ Terminal & SNMP ➡ Terminal.

  • Docker is required - Synology-Docker updates the binaries of an existing Docker installation only. Install Docker on your NAS in DSM via Package Center ➡ All Packages ➡ Docker and ensure the status is Running.

  • SynoCommunity/Git is required - Synology-Docker needs the Git package from SynoCommunity installed on your NAS. Install Git on your NAS by adding the SynoCommunity package repository (described here) and installing the Git package in DSM via Package Center ➡ Community ➡ Git.

Deployment

Deployment of Synology-Docker is a matter of cloning the GitHub repository. Login to your NAS terminal via SSH first. Assuming you are in the working folder of your choice, clone the repository files. Git automatically creates a new folder synology-docker and copies the files to this directory. Then change your current folder to simplify the execution of the shell script.

$ git clone https://github.com/markdumay/synology-docker.git
$ cd synology-docker

Usage

Synology-Docker requires sudo rights. Use the following command to invoke Synology-Docker from the command line.

$ sudo ./syno_docker_update.sh [OPTIONS] COMMAND

Commands

Synology-Docker supports the following commands.

Command Argument Description
backup Create a backup of Docker binaries (including Docker Compose), dockerd configuration, and Synology's start-stop-status script
download PATH Download Docker and Docker Compose binaries to PATH
install PATH Update Docker and Docker Compose from files on PATH
restore Restore Docker and Docker Compose from a backup
update Update Docker and Docker Compose to a target version (creates a backup first)

Under the hood, the five different commands invoke a specific workflow or sequence of steps. The below table shows the workflows and the order of steps for each of the commands.

# Workflow step backup download install restore update
A) Download Docker binary Step 1 Step 1
B) Download Compose binary Step 2 Step 2
C) Extract files from backup Step 1
D) Stop Docker daemon Step 1 Step 1 Step 2 Step 3
E) Backup current files Step 2 Step 2 Step 4
F) Extract downloaded binaries Step 3 Step 5
G) Restore Docker binaries Step 3
H) Install Docker binaries Step 4 Step 6
I) Update log driver Step 5 Step 7
J) Restore log driver Step 4
K) Update Docker script Step 5 Step 8
L) Restore Docker script Step 5
M) Start Docker daemon Step 3 Step 6 Step 6 Step 9
N) Clean temp folder Step 10
  • A) Download Docker binary - Downloads an archive containing Docker Engine binaries from https://download.docker.com/linux/static/stable/x86_64/docker-${VERSION}.tgz. The binaries are compatible with the Intel x86 (64 bit) architecture. Unless a specific version is specified by the --docker flag, Synology-Docker pulls the latest stable version available.
  • B) Download Compose binary - Downloads the Docker Compose binary from https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-Linux-x86_64. Unless a specific version is specified by the --compose flag, Synology-Docker pulls the latest stable version available.
  • C) Extract files from backup - Extracts the files from a backup archive specified by the --backup flag to the temp directory (/tmp/docker_update).
  • D) Stop Docker daemon - Stops the Docker daemon by invoking synoservicectl --stop pkgctl-Docker.
  • E) Backup current files - Creates a backup of the current Docker binaries, including Docker Compose. The configuration of the logging driver and Synology's start-stop-status script are included in the archive too. The files included refer to /var/packages/Docker/target/usr/bin/*, /var/packages/Docker/etc/dockerd.json, and /var/packages/Docker/scripts/start-stop-status.
  • F) Extract downloaded binaries - Extracts the files from a downloaded archive to the temp directory (/tmp/docker_update).
  • G) Restore Docker binaries - Restores the Docker binaries in /var/packages/Docker/target/usr/bin/* with the binaries extracted from a backup archive.
  • H) Install Docker binaries - Installs downloaded and extracted Docker binaries (including Docker Compose) to the folder /var/packages/Docker/target/usr/bin/.
  • I) Update log driver - Replaces Synology's log driver with a default log driver json-file to improve compatibility. The configuration is updated at /var/packages/Docker/etc/dockerd.json
  • J) Restore log driver - Restores the log driver (/var/packages/Docker/etc/dockerd.json) from the configuration within a backup archive.
  • K) Update Docker script - Updates Synology's start-stop-status script for Docker to enable IP forwarding. This ensures containers can be properly reached in bridge networking mode. The script is updated at the location /var/packages/Docker/scripts/start-stop-status.
  • L) Restore Docker script - Restores the start-stop-status script (/var/packages/Docker/scripts/start-stop-status) from the file within a backup archive.
  • M) Start Docker daemon - Starts the Docker daemon by invoking synoservicectl --start pkgctl-Docker.
  • N) Clean temp folder - Removes files from the temp directory (/tmp/docker_update). The temporary files are created when extracting a downloaded archive or extracting a backup.

Options

Synology-Docker supports the following options.

Option Alias Argument Description
-b --backup NAME Name of the backup (defaults to docker_backup_YYMMDDHHMMSS.tgz)
-c --compose VERSION Specify the Docker Compose target version (defaults to latest available on github.com)
-d --docker VERSION Specify the Docker target version (defaults to latest available on docker.com)
-f --force Force the update and bypass compatibility check / confirmation check
-p --path Path of the backup (defaults to current directory)
-s --stage Stage only, do not replace binaries or the configuration of log driver

Known Issues

This link contains an overview of known issues, including available workarounds.

Contributing

  1. Clone the repository and create a new branch
    $ git checkout https://github.com/markdumay/synology-docker.git -b name_for_new_branch
  2. Make and test the changes
  3. Submit a Pull Request with a comprehensive description of the changes

Credits

Synology-Docker is inspired by this gist from Mikado8231.

Donate

Buy Me A Coffee

License

Copyright © Mark Dumay

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].