Skip to main content

Docker

Overview

Docker API implementation.

Provides methods to interact with Docker containers, images, registries, networks, projects, logs, migration, and utilities on a Synology NAS.

Covers all 12 SYNO.Docker.* API namespaces exposed by DSM.

Methods

containers

Get list of containers.

Internal API

SYNO.Docker.Container

Returns

dict[str, object]
A dictionary containing the containers information.

Example return

Click to expand
{
"data": {
"1111aaaa-22bb-33cc-44dd-555555eeeeee": {
"containerIds": [
"21bbe0c6a5d3b246f347367826a78db47f0f334a44bd6621e084f68f0ad63044"
],
"created_at": "2025-03-14T14:07:04.874304Z",
"enable_service_portal": true,
"id": "187b2816-fd6c-4f87-b178-6d94806c7404",
"is_package": false,
"name": "pihole",
"path": "/volume1/docker/test",
"service_portal_name": "test",
"service_portal_port": 53,
"service_portal_protocol": "http",
"services": [
{
"display_name": "test (project)",
"id": "Docker-Project-187b2816-fd6c-4f87-b178-6d94806c7404",
"proxy_target": "http://127.0.0.1:53",
"service": "Docker-Project-187b2816-fd6c-4f87-b178-6d94806c7404",
"type": "reverse_proxy"
}
],
"share_path": "/docker/test",
"state": "",
"status": "STOPPED",
"updated_at": "2025-03-14T15:17:31.840634Z",
"version": 2
},
"2222bbbb-33cc-44dd-55ee-666666ffffff": {
"containerIds": [
"d9301fc3aa925514760e7714a489cc2d14a26ed6e8169479ac6c356de6b5a7d9",
"89d63c6c3c4e299c82c2dcc4ba353c4c1e6c1c938b572153fe9f615646edc4f6",
"4a37c7a4a5cab34658071972c2c2bc3ff89dc6dc1407fd98751c7f227574a088",
"6df4151b6e24ea3b68b62851d65c8a830e342085f6f9cf0cfdf1e6f98357d9b1",
"1a1088cdf8d56e2443c22fa5c6f5658384ba894fe050d82b9214fb84342b0d93",
"36984528684d20c775ac67b3a286e48a5aa8ba73a36f58cfd062a8649d457328"
],
"created_at": "2024-07-21T11:01:31.019924Z",
"enable_service_portal": true,
"id": "d787e5ac-1b6a-4dd4-a2d9-35bcd5ad9577",
"is_package": false,
"name": "test2",
"path": "/volume1/docker/test2",
"service_portal_name": "test2-server",
"service_portal_port": 2283,
"service_portal_protocol": "http",
"services": [
{
"display_name": "test2 (project)",
"id": "Docker-Project-d787e5ac-1b6a-4dd4-a2d9-35bcd5ad9577",
"proxy_target": "http://127.0.0.1:2283",
"service": "Docker-Project-d787e5ac-1b6a-4dd4-a2d9-35bcd5ad9577",
"type": "reverse_proxy"
}
],
"share_path": "/docker/test2",
"state": "",
"status": "ERROR",
"updated_at": "2025-06-12T14:48:08.127657Z",
"version": 2
}
},
"success": true
}

container_resources

Get resources of all containers.

Internal API

SYNO.Docker.Container.Resource

Returns

dict[str, object]
A dictionary containing the resources information of the containers.

Example return

Click to expand
    {
"data": {
"resources": [
{
"cpu": 0,
"memory": 21106688,
"memoryPercent": 0.517403244972229,
"name": "container1"
},
{
"cpu": 0,
"memory": 0,
"memoryPercent": 0,
"name": "container2"
},
{
"cpu": 0,
"memory": 0,
"memoryPercent": 0,
"name": "stopped_container"
}
]
},
"httpd_restart": false,
"success": true
}

system_resources

Get system resources.

Internal API

SYNO.Core.System.Utilization

Returns

dict[str, object]
A dictionary containing the system resources information.

Example return

Click to expand
{
"data" : {
"cpu" : {
"15min_load" : 14,
"1min_load" : 29,
"5min_load" : 16,
"device" : "System",
"other_load" : 2,
"system_load" : 0,
"user_load" : 1
},
"disk" : {
"disk" : [
{
"device" : "sata2",
"display_name" : "Drive 2",
"read_access" : 0,
"read_byte" : 0,
"type" : "internal",
"utilization" : 0,
"write_access" : 0,
"write_byte" : 0
},
{
"device" : "sata1",
"display_name" : "Drive 1",
"read_access" : 0,
"read_byte" : 0,
"type" : "internal",
"utilization" : 0,
"write_access" : 0,
"write_byte" : 0
}
],
"total" : {
"device" : "total",
"read_access" : 0,
"read_byte" : 0,
"utilization" : 0,
"write_access" : 0,
"write_byte" : 0
}
},
"lun" : [],
"memory" : {
"avail_real" : 444840,
"avail_swap" : 4163752,
"buffer" : 21716,
"cached" : 2658180,
"device" : "Memory",
"memory_size" : 4194304,
"real_usage" : 21,
"si_disk" : 0,
"so_disk" : 0,
"swap_usage" : 7,
"total_real" : 3983740,
"total_swap" : 4489140
},
"network" : [
{
"device" : "total",
"rx" : 6822,
"tx" : 6336
},
{
"device" : "eth0",
"rx" : 0,
"tx" : 0
},
{
"device" : "eth1",
"rx" : 0,
"tx" : 0
},
{
"device" : "eth2",
"rx" : 6822,
"tx" : 6336
}
],
"nfs" : [],
"smb" : {
"smb_cmd" : [],
"smb_cpu" : [],
"smb_rwpkt" : []
},
"space" : {
"total" : {
"device" : "total",
"read_access" : 0,
"read_byte" : 0,
"utilization" : 0,
"write_access" : 0,
"write_byte" : 0
},
"volume" : [
{
"device" : "dm-1",
"display_name" : "volume1",
"read_access" : 0,
"read_byte" : 0,
"utilization" : 0,
"write_access" : 0,
"write_byte" : 0
}
]
},
"time" : 1749998465
},
"httpd_restart" : false,
"success" : true
}

downloaded_images

List of docker images available on Synology NAS.

Internal API

SYNO.Docker.Image

Parameters

limit int
The maximum number of docker images to return. Defaults -1 (all).

offset int
The offset for pagination. Defaults to 0.

show_dsm bool
Defaults to False.

Returns

dict[str, object]
A dictionary containing the list of downloaded images.

Example return

Click to expand
{
"data" : {
"images" : [
{
"created" : 1745034718,
"description" : "",
"digest" : "",
"id" : "sha256:14300de7e087290520999f00d6a12b61385d1fe780ea83f38eabb7e8be66225f",
"remote_digest" : "",
"repository" : "caddy",
"size" : 50509416,
"tags" : [ "alpine" ],
"upgradable" : false,
"virtual_size" : 50509416
}
],
"limit" : 1,
"offset" : 0,
"total" : 1
},
"httpd_restart" : false,
"success" : true
}

images_registry_resources

Get list of docker registries.

Internal API

SYNO.Docker.Registry

Returns

dict[str, object]
A dictionary containing the list of docker registries.

Example return

Click to expand
{
"data" : {
"offset" : 0,
"registries" : [
{
"enable_registry_mirror" : false,
"enable_trust_SSC" : true,
"mirror_urls" : [],
"name" : "Docker Hub",
"syno" : true,
"url" : "https://registry.hub.docker.com"
}
],
"total" : 1,
"using" : "Docker Hub"
},
"httpd_restart" : false,
"success" : true
}

network

Get list of docker networks.

Internal API

SYNO.Docker.Network

Returns

dict[str, object]
A dictionary containing the list of docker networks.

Example return

Click to expand
{
"data" : {
"network" : [
{
"containers" : [ "vault" ],
"driver" : "bridge",
"enable_ipv6" : false,
"gateway" : "172.22.0.1",
"id" : "b741915823aacdffc8ab806ab348e198c2c486b4dd5df2627b0d586259926b1a",
"iprange" : "",
"name" : "vault_default",
"subnet" : "172.22.0.0/16"
},
{
"containers" : [],
"driver" : "host",
"enable_ipv6" : false,
"gateway" : "",
"id" : "2fc7ebae3901359e7bc9d7b50fad1f6aa2f8c1076474cadc9f83b3256f921ff3",
"iprange" : "",
"name" : "host",
"subnet" : ""
}
]
},
"httpd_restart" : false,
"success" : true
}

search_image

Search for docker image in all available registries.

Internal API

SYNO.Docker.Registry

Parameters

query str
Name of the docker image to search for. Defaults to None.

Returns

dict[str, object]
A dictionary containing the search results for the docker image.

Example return

Click to expand
{
"data" : {
"data" : [
{
"description" : "Caddy 2 is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go.",
"downloads" : 650989718,
"is_automated" : false,
"is_official" : true,
"name" : "caddy",
"registry" : "https://registry.hub.docker.com",
"star_count" : 881
},
{
"description" : "Caddy is a lightweight, general-purpose web server.",
"downloads" : 111974910,
"is_automated" : true,
"is_official" : false,
"name" : "abiosoft/caddy",
"registry" : "https://registry.hub.docker.com",
"star_count" : 289
}
],
"limit" : 50,
"offset" : 0,
"page_size" : 50,
"total" : 6647
},
"httpd_restart" : false,
"success" : true
}

list_projects

Get list of projects.

Internal API

SYNO.Docker.Project

Returns

dict[str, object]
A dictionary containing the list of projects.

Example return

Click to expand
{
"data" : {
"187b2816-fd6c-4f87-b178-6d94806c7404" : {
"containerIds" : [ "21bbe0c6a5d3b246f347367826a78db47f0f334a44bd6621e084f68f0ad63044" ],
"created_at" : "2025-03-14T14:07:04.874304Z",
"enable_service_portal" : true,
"id" : "187b2816-fd6c-4f87-b178-6d94806c7404",
"is_package" : false,
"name" : "project1",
"path" : "/volume1/docker/project1",
"service_portal_name" : "project1",
"service_portal_port" : 53,
"service_portal_protocol" : "http",
"services" : [
{
"display_name" : "project1 (project)",
"id" : "Docker-Project-187b2816-fd6c-4f87-b178-6d94806c7404",
"proxy_target" : "http://127.0.0.1:53",
"service" : "Docker-Project-187b2816-fd6c-4f87-b178-6d94806c7404",
"type" : "reverse_proxy"
}
],
"share_path" : "/docker/project1",
"state" : "",
"status" : "STOPPED",
"updated_at" : "2025-03-14T15:17:31.840634Z",
"version" : 2
},
"3c091e8b-f68f-4161-97a3-fc3db3f4bdc9" : {
"containerIds" : [ "ee220111cff2d2e7b9d764a4b781f9e23faa3cd7f3048d315aa6c95d48f0a1e4" ],
"created_at" : "2025-05-27T08:33:03.213407Z",
"enable_service_portal" : false,
"id" : "3c091e8b-f68f-4161-97a3-fc3db3f4bdc9",
"is_package" : false,
"name" : "project2",
"path" : "/volume1/docker/project2",
"service_portal_name" : "",
"service_portal_port" : 0,
"service_portal_protocol" : "",
"services" : [],
"share_path" : "/docker/project2",
"state" : "",
"status" : "RUNNING",
"updated_at" : "2025-06-15T10:38:52.247951Z",
"version" : 2
}
},
"httpd_restart" : false,
"success" : true
}

get_project_info

Get information about a specific project.

Internal API

SYNO.Docker.Project

Parameters

project_id str
ID of the project to get information about. Defaults to None.

Returns

dict[str, object]
A dictionary containing the project information.

Example return

Click to expand
{
"data" : {
"containerIds" : [ "1f2aa674d7942c25789c144c1e4ea04388e5a914e1ed3d7a1b8978f8f2f81ebf" ],
"containers" : [
{
"AppArmorProfile" : "docker-default",
"Args" : [ "server", "-config=/vault/file/" ],
"Config" : {
"AttachStderr" : true,
"AttachStdin" : false,
"AttachStdout" : true,
"Cmd" : null,
"Domainname" : "",
"Entrypoint" : [ "vault", "server", "-config=/vault/file/" ],
"Env" : [
"VAULT_RAFT_PATH=/vault/file",
"VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NAME=vault",
"VERSION="
],
"ExposedPorts" : {
"8200/tcp" : {}
},
"Healthcheck" : {
"Interval" : 30000000000,
"Retries" : 5,
"Test" : [ "CMD", "vault", "status" ],
"Timeout" : 10000000000
},
"Hostname" : "vault",
"Image" : "hashicorp/vault:latest",
"Labels" : {
"com.docker.compose.config-hash" : "6a08fb0e6d57f8ad25b3d78cac40d369be831be5cf98406520e514d68aa03251",
"com.docker.compose.container-number" : "1",
"com.docker.compose.depends_on" : "",
"com.docker.compose.image" : "sha256:2006f053b116f3a57dad1d8fff9d19c13f3e801e594dcbd58e219d4ccb654337",
"com.docker.compose.oneoff" : "False",
"com.docker.compose.project" : "vault",
"com.docker.compose.project.config_files" : "/volume1/docker/vault/compose.yaml",
"com.docker.compose.project.working_dir" : "/volume1/docker/vault",
"com.docker.compose.replace" : "1153d033ece9eb4242926f805a211daed65922652fdf73ffcf8147e20e4c0ce2",
"com.docker.compose.service" : "vault",
"com.docker.compose.version" : "2.20.1",
"description" : "Vault is a tool for securely accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. Vault provides a unified interface to any secret, while providing tight access control and recording a detailed audit log.",
"maintainer" : "Vault Team <vault@hashicorp.com>",
"name" : "Vault",
"release" : "322786e236e268532e4b189845971ba67b5cbb23",
"revision" : "322786e236e268532e4b189845971ba67b5cbb23",
"summary" : "Vault is a tool for securely accessing secrets.",
"vendor" : "HashiCorp",
"version" : "1.19.4"
},
"OnBuild" : null,
"OpenStdin" : false,
"StdinOnce" : false,
"Tty" : false,
"User" : "",
"Volumes" : {
"/vault/file" : {},
"/vault/logs" : {}
},
"WorkingDir" : "/"
},
"Created" : "2025-05-25T17:57:06.296933361Z",
"Driver" : "btrfs",
"ExecIDs" : null,
"GraphDriver" : {
"Data" : null,
"Name" : "btrfs"
},
"HostConfig" : {
"AutoRemove" : false,
"Binds" : [
"/volume1/docker/vault/data:/vault/file:rw",
"/volume1/docker/vault/logs:/vault/logs:rw",
"/volume1/docker/vault/config:/vault/config:rw",
"/volume1/docker/vault/plugins:/vault/plugins:rw",
"/etc/localtime:/etc/localtime:ro"
],
"BlkioDeviceReadBps" : null,
"BlkioDeviceReadIOps" : null,
"BlkioDeviceWriteBps" : null,
"BlkioDeviceWriteIOps" : null,
"BlkioWeight" : 0,
"BlkioWeightDevice" : null,
"CapAdd" : [ "IPC_LOCK" ],
"CapDrop" : null,
"Cgroup" : "",
"CgroupParent" : "",
"CgroupnsMode" : "host",
"ConsoleSize" : [ 0, 0 ],
"ContainerIDFile" : "",
"CpuCount" : 0,
"CpuPercent" : 0,
"CpuPeriod" : 0,
"CpuQuota" : 0,
"CpuRealtimePeriod" : 0,
"CpuRealtimeRuntime" : 0,
"CpuShares" : 768,
"CpusetCpus" : "",
"CpusetMems" : "",
"DeviceCgroupRules" : null,
"DeviceRequests" : null,
"Devices" : null,
"Dns" : [],
"DnsOptions" : [],
"DnsSearch" : [],
"ExtraHosts" : [],
"GroupAdd" : null,
"IOMaximumBandwidth" : 0,
"IOMaximumIOps" : 0,
"IpcMode" : "private",
"Isolation" : "",
"Links" : null,
"LogConfig" : {
"Config" : {},
"Type" : "db"
},
"MaskedPaths" : [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"Memory" : 536870912,
"MemoryReservation" : 0,
"MemorySwap" : 1073741824,
"MemorySwappiness" : null,
"NanoCpus" : 0,
"NetworkMode" : "vault_default",
"OomKillDisable" : false,
"OomScoreAdj" : 0,
"PidMode" : "",
"PidsLimit" : null,
"PortBindings" : {
"8200/tcp" : [
{
"HostIp" : "",
"HostPort" : "8205"
}
]
},
"Privileged" : false,
"PublishAllPorts" : false,
"ReadonlyPaths" : [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
],
"ReadonlyRootfs" : false,
"RestartPolicy" : {
"MaximumRetryCount" : 5,
"Name" : "on-failure"
},
"Runtime" : "runc",
"SecurityOpt" : [ "no-new-privileges:true" ],
"ShmSize" : 67108864,
"UTSMode" : "",
"Ulimits" : null,
"UsernsMode" : "",
"VolumeDriver" : "",
"VolumesFrom" : null
},
"HostnamePath" : "/volume1/@docker/containers/1f2aa674d7942c25789c144c1e4ea04388e5a914e1ed3d7a1b8978f8f2f81ebf/hostname",
"HostsPath" : "/volume1/@docker/containers/1f2aa674d7942c25789c144c1e4ea04388e5a914e1ed3d7a1b8978f8f2f81ebf/hosts",
"Id" : "1f2aa674d7942c25789c144c1e4ea04388e5a914e1ed3d7a1b8978f8f2f81ebf",
"Image" : "sha256:2006f053b116f3a57dad1d8fff9d19c13f3e801e594dcbd58e219d4ccb654337",
"LogPath" : "/volume1/@docker/containers/1f2aa674d7942c25789c144c1e4ea04388e5a914e1ed3d7a1b8978f8f2f81ebf/log.db",
"MountLabel" : "",
"Mounts" : [
{
"Destination" : "/vault/plugins",
"Mode" : "rw",
"Propagation" : "rprivate",
"RW" : true,
"Source" : "/volume1/docker/vault/plugins",
"Type" : "bind"
},
{
"Destination" : "/etc/localtime",
"Mode" : "ro",
"Propagation" : "rprivate",
"RW" : false,
"Source" : "/etc/localtime",
"Type" : "bind"
},
{
"Destination" : "/vault/config",
"Mode" : "rw",
"Propagation" : "rprivate",
"RW" : true,
"Source" : "/volume1/docker/vault/config",
"Type" : "bind"
},
{
"Destination" : "/vault/file",
"Mode" : "rw",
"Propagation" : "rprivate",
"RW" : true,
"Source" : "/volume1/docker/vault/data",
"Type" : "bind"
},
{
"Destination" : "/vault/logs",
"Mode" : "rw",
"Propagation" : "rprivate",
"RW" : true,
"Source" : "/volume1/docker/vault/logs",
"Type" : "bind"
}
],
"Name" : "/vault",
"NetworkSettings" : {
"Bridge" : "",
"EndpointID" : "",
"Gateway" : "",
"GlobalIPv6Address" : "",
"GlobalIPv6PrefixLen" : 0,
"HairpinMode" : false,
"IPAddress" : "",
"IPPrefixLen" : 0,
"IPv6Gateway" : "",
"LinkLocalIPv6Address" : "",
"LinkLocalIPv6PrefixLen" : 0,
"MacAddress" : "",
"Networks" : {
"vault_default" : {
"Aliases" : [ "vault", "vault", "1f2aa674d794" ],
"DriverOpts" : null,
"EndpointID" : "",
"Gateway" : "",
"GlobalIPv6Address" : "",
"GlobalIPv6PrefixLen" : 0,
"IPAMConfig" : null,
"IPAddress" : "",
"IPPrefixLen" : 0,
"IPv6Gateway" : "",
"Links" : null,
"MacAddress" : "",
"NetworkID" : "b741915823aacdffc8ab806ab348e198c2c486b4dd5df2627b0d586259926b1a"
}
},
"Ports" : {},
"SandboxID" : "d523ddff9d90b2ecc74f20c33db7b4898fa2869f10899ccc6567febd64d7142c",
"SandboxKey" : "/var/run/docker/netns/d523ddff9d90",
"SecondaryIPAddresses" : null,
"SecondaryIPv6Addresses" : null
},
"Path" : "vault",
"Platform" : "linux",
"ProcessLabel" : "",
"ResolvConfPath" : "/volume1/@docker/containers/1f2aa674d7942c25789c144c1e4ea04388e5a914e1ed3d7a1b8978f8f2f81ebf/resolv.conf",
"RestartCount" : 5,
"State" : {
"Dead" : false,
"Error" : "",
"ExitCode" : 1,
"FinishedAt" : "2025-05-25T17:57:30.266770048Z",
"Health" : {
"FailingStreak" : 0,
"Log" : [],
"Status" : "unhealthy"
},
"OOMKilled" : false,
"Paused" : false,
"Pid" : 0,
"Restarting" : false,
"Running" : false,
"StartedAt" : "2025-05-25T17:57:30.184237615Z",
"Status" : "exited"
}
}
],
"content" : "docker-compose.yml contet",
"created_at" : "2025-05-25T17:31:00.875402Z",
"enable_service_portal" : false,
"id" : "b4d44e6c-5ab4-45f7-b380-481ef9839df1",
"is_package" : false,
"name" : "vault",
"path" : "/volume1/docker/vault",
"service_portal_name" : "",
"service_portal_port" : 0,
"service_portal_protocol" : "",
"services" : null,
"share_path" : "/docker/vault",
"state" : "",
"status" : "STOPPED",
"updated_at" : "2025-05-25T17:57:06.257863Z",
"version" : 2
},
"httpd_restart" : false,
"success" : true
}

start_container

Start a container by its name.

Internal API

SYNO.Docker.Container

Parameters

container str
The name of the container.

Returns

dict[str, object]
A dictionary containing the result of the export operation.

Example return

Click to expand
{
"data" : {
"cpu" : 0,
"memory" : 21241856,
"memoryPercent" : 0.52071672677993774,
"name" : "glance",
"start_dependent_container" : false
},
"httpd_restart" : false,
"success" : true
}

stop_container

Stop a container by its name.

Internal API

SYNO.Docker.Container

Parameters

container str
The name of the container.

Returns

dict[str, object]
A dictionary containing the result of the stop operation.

Example return

Click to expand
{
"data" : {
"cpu" : 0,
"memory" : 0,
"memoryPercent" : 0,
"name" : "glance"
},
"httpd_restart" : false,
"success" : true
}

export_container_settings

Export container profile.
file <container>.syno.json will be created in the specified path.

Internal API

SYNO.Docker.Container.Profile

Parameters

container str
The name of the container.

path str
The path on filesystem of Synology NAS where the container settings will be exported. If not specified, the file will be offered as a download through the browser. For example: /docker/nging.

Returns

dict[str, object]
A dictionary containing the result of the export operation.

Example return

Click to expand
    {
"data" : {},
"httpd_restart" : false,
"success" : true
}

export_container

Export container profile and content to a specified path on Synology nas.
archive <container>.syno.txz will be created in the specified path.

Internal API

SYNO.Docker.Container

Parameters

container str
The name of the container.

path str
The path on filesystem of Synology NAS where the container settings will be exported. For example: /docker/nging.

Returns

dict[str, object]
A dictionary containing the result of the export operation.

Example return

Click to expand
    {
"data" : {},
"httpd_restart" : false,
"success" : true
}

get_logs

Get list of container logs.

Internal API

SYNO.Docker.Container.Log

Parameters

name str
The name of the container.

from_date str
The start date for the logs. Defaults to None.

to_date str
The end date for the logs. Defaults to None.

level str
The log level to filter by. Defaults to None.

keyword str
Keyword to filter logs. Defaults to None.

sort_dir str
Sort direction for the logs, either 'ASC' or 'DESC'. Defaults to 'DESC'.

offset int
The offset for pagination. Defaults to 0.

limit int
The maximum number of logs to return. Defaults to 1000.

Returns

dict[str, object]
A dictionary containing the logs from the specified container.

Example return

Click to expand
    {
"data": {
"limit": 1,
"logs": [
{
"created": "2025-06-15T10:38:55.869358659Z",
"docid": "1",
"stream": "stderr",
"text": "2025/06/15 10:38:55 Starting server on :8080"
}
],
"offset": 0,
"total": 1
},
"success": true
}

docker_stats

Get containers resource usage statistics.

Internal API

SYNO.Docker.Container

Returns

dict[str, object]
A dictionary containing the resource usage statistics of the containers.

Example return

Click to expand
    {
"data" : {
"ee220111cff2d2e7b9d764a4b781f9e23faa3cd7f3048d315aa6c95d48f0a1e4" : {
"blkio_stats" : {
"io_merged_recursive" : [],
"io_queue_recursive" : [],
"io_service_bytes_recursive" : [],
"io_service_time_recursive" : [],
"io_serviced_recursive" : [],
"io_time_recursive" : [],
"io_wait_time_recursive" : [],
"sectors_recursive" : []
},
"cpu_stats" : {
"cpu_usage" : {
"percpu_usage" : [ 286394951, 245078386, 304613157, 186566695 ],
"total_usage" : 1022653189,
"usage_in_kernelmode" : 380000000,
"usage_in_usermode" : 580000000
},
"online_cpus" : 4,
"system_cpu_usage" : 990015100000000,
"throttling_data" : {
"periods" : 0,
"throttled_periods" : 0,
"throttled_time" : 0
}
},
"id" : "ee220111cff2d2e7b9d764a4b781f9e23faa3cd7f3048d315aa6c95d48f0a1e4",
"memory_stats" : {
"limit" : 4079349760,
"max_usage" : 22630400,
"stats" : {
"active_anon" : 5500928,
"active_file" : 1294336,
"cache" : 15626240,
"dirty" : 0,
"hierarchical_memory_limit" : 9223372036854771712,
"hierarchical_memsw_limit" : 9223372036854771712,
"inactive_anon" : 0,
"inactive_file" : 14331904,
"mapped_file" : 11005952,
"pgfault" : 43383,
"pgmajfault" : 6,
"pgpgin" : 33405,
"pgpgout" : 28247,
"rss" : 5500928,
"rss_huge" : 0,
"total_active_anon" : 5500928,
"total_active_file" : 1294336,
"total_cache" : 15626240,
"total_dirty" : 0,
"total_inactive_anon" : 0,
"total_inactive_file" : 14331904,
"total_mapped_file" : 11005952,
"total_pgfault" : 43383,
"total_pgmajfault" : 6,
"total_pgpgin" : 33405,
"total_pgpgout" : 28247,
"total_rss" : 5500928,
"total_rss_huge" : 0,
"total_unevictable" : 0,
"total_writeback" : 0,
"unevictable" : 0,
"writeback" : 0
},
"usage" : 21127168
},
"name" : "/glance",
"networks" : {
"eth0" : {
"rx_bytes" : 876,
"rx_dropped" : 0,
"rx_errors" : 0,
"rx_packets" : 10,
"tx_bytes" : 0,
"tx_dropped" : 0,
"tx_errors" : 0,
"tx_packets" : 0
}
},
"num_procs" : 0,
"pids_stats" : {},
"precpu_stats" : {
"cpu_usage" : {
"total_usage" : 0,
"usage_in_kernelmode" : 0,
"usage_in_usermode" : 0
},
"throttling_data" : {
"periods" : 0,
"throttled_periods" : 0,
"throttled_time" : 0
}
},
"preread" : "0001-01-01T00:00:00Z",
"read" : "2025-06-15T14:11:00.431111646Z",
"storage_stats" : {}
}
},
"httpd_restart" : false,
"success" : true
}


get_container

Get detailed information about a single container.

Internal API

SYNO.Docker.Container

Parameters

name str
The name of the container.

Returns

dict[str, object]
Detailed container inspect data (Config, HostConfig, State, etc.).


restart_container

Restart a container by name.

Internal API

SYNO.Docker.Container

Parameters

container str
The name of the container to restart.

Returns

dict[str, object]
Result of the restart operation.


delete_container

Delete a container.

Internal API

SYNO.Docker.Container

Parameters

name str
The name of the container to delete.

force bool
Force-remove a running container. Defaults to False.

Returns

dict[str, object]
Result of the delete operation.


create_container

Create a new container from a profile definition.

Internal API

SYNO.Docker.Container

Parameters

profile dict
A container profile dictionary containing image, name, port bindings, volume mounts, environment variables, etc. Matches the JSON format produced by export_container_settings.

Returns

dict[str, object]
Result of the creation, including the new container name.


signal_container

Send a signal to a running container.

Internal API

SYNO.Docker.Container

Parameters

name str
The name of the container.

signal int
Unix signal number to send. Defaults to 15 (SIGTERM).

Returns

dict[str, object]
Result of the signal operation.


get_pkg_profile

Get the profile of a package-managed container.
Package-managed containers are created by Synology packages (e.g. Surveillance Station, MailPlus) rather than by users directly.

Internal API

SYNO.Docker.Container.PkgProfile

Parameters

name str
The name of the package-managed container.

Returns

dict[str, object]
The package profile definition for the container.


list_pkg_profiles

List all package-managed container profiles.

Internal API

SYNO.Docker.Container.PkgProfile

Returns

dict[str, object]
A list of all package-managed container profiles.


get_container_profile

Get the full profile/configuration of a container.

Internal API

SYNO.Docker.Container.Profile

Parameters

name str
The name of the container.

Returns

dict[str, object]
The full container profile (image, ports, volumes, env, etc.).


import_container_profile

Import / apply a profile to a container.

Internal API

SYNO.Docker.Container.Profile

Parameters

name str
The name of the container to update.

profile dict
The profile dictionary to apply.

Returns

dict[str, object]
Result of the import operation.


pull_image

Pull a Docker image from the active registry.

Internal API

SYNO.Docker.Image

Parameters

repository str
The repository name (e.g. "nginx", "grafana/grafana").

tag str
The image tag to pull. Defaults to "latest".

Returns

dict[str, object]
Result of the pull operation.


delete_image

Delete a local Docker image.

Internal API

SYNO.Docker.Image

Parameters

name str
The repository name (e.g. "nginx").

tag str
The image tag to delete. Defaults to "latest".

Returns

dict[str, object]
Result of the delete operation.


export_image

Export a Docker image to a tar archive on the NAS.

Internal API

SYNO.Docker.Image

Parameters

name str
The repository name.

tag str
The image tag. Defaults to "latest".

path str
Destination path on the NAS. Defaults to "/docker".

Returns

dict[str, object]
Result of the export operation.


import_image

Import a Docker image from a tar archive on the NAS.

Internal API

SYNO.Docker.Image

Parameters

path str
Path to the image archive on the NAS filesystem (e.g. "/docker/nginx_latest.tar").

Returns

dict[str, object]
Result of the import operation.


get_image

Get detailed information about a local Docker image.

Internal API

SYNO.Docker.Image

Parameters

name str
The repository name.

tag str
The image tag. Defaults to "latest".

Returns

dict[str, object]
Detailed image metadata.


create_registry

Add a new Docker registry.

Internal API

SYNO.Docker.Registry

Parameters

name str
Display name for the registry.

url str
Registry URL (e.g. "https://ghcr.io").

username str
Authentication username.

password str
Authentication password.

enable_trust_ssc bool
Trust self-signed certificates. Defaults to True.

Returns

dict[str, object]
Result of the create operation.


set_registry

Update an existing Docker registry configuration.

Internal API

SYNO.Docker.Registry

Parameters

name str
Display name of the registry to update.

url str
Registry URL.

username str
Authentication username.

password str
Authentication password.

enable_trust_ssc bool
Trust self-signed certificates. Defaults to True.

Returns

dict[str, object]
Result of the update operation.


delete_registry

Remove a Docker registry.

Internal API

SYNO.Docker.Registry

Parameters

name str
The display name of the registry to remove.

Returns

dict[str, object]
Result of the delete operation.


set_using_registry

Set the active (default) Docker registry.

Internal API

SYNO.Docker.Registry

Parameters

name str
The display name of the registry to make active.

Returns

dict[str, object]
Result of the operation.


get_image_tags

List available tags for an image in the registry.
Uses v2 of the Registry API for paginated tag listing.

Internal API

SYNO.Docker.Registry

Parameters

repository str
The image repository name (e.g. "nginx").

offset int
Pagination offset. Defaults to 0.

limit int
Maximum tags to return. Defaults to 50.

Returns

dict[str, object]
A dictionary containing the list of available tags.


create_network

Create a new Docker network.

Internal API

SYNO.Docker.Network

Parameters

name str
Name of the network.

driver str
Network driver. Defaults to "bridge".

subnet str
Subnet in CIDR notation (e.g. "172.28.0.0/16").

gateway str
Gateway IP address.

ip_range str
Allocatable IP range in CIDR notation.

enable_ipv6 bool
Enable IPv6 on the network. Defaults to False.

Returns

dict[str, object]
Result of the creation, including the new network ID.


delete_network

Delete a Docker network.

Internal API

SYNO.Docker.Network

Parameters

name str
The name of the network to delete.

Returns

dict[str, object]
Result of the delete operation.


get_network

Get detailed information about a Docker network.

Internal API

SYNO.Docker.Network

Parameters

name str
The name of the network.

Returns

dict[str, object]
Network details including driver, subnet, containers, etc.


create_project

Create a new Docker Compose project.

Internal API

SYNO.Docker.Project

Parameters

name str
Project name.

share_path str
Shared-folder path where the compose file lives (e.g. "/docker/myproject").

content str
The docker-compose YAML content as a string.

enable_service_portal bool
Enable the DSM reverse-proxy portal. Defaults to False.

service_portal_name str
Portal display name.

service_portal_port int
Portal target port.

service_portal_protocol str
Portal protocol. Defaults to "http".

Returns

dict[str, object]
Result including the new project ID.


update_project

Update an existing Docker Compose project.

Internal API

SYNO.Docker.Project

Parameters

project_id str
The UUID of the project.

content str
Updated docker-compose YAML content.

enable_service_portal bool
Update the portal setting.

service_portal_name str
Update portal name.

service_portal_port int
Update portal port.

service_portal_protocol str
Update portal protocol.

Returns

dict[str, object]
Result of the update operation.


delete_project

Delete a Docker Compose project.

Internal API

SYNO.Docker.Project

Parameters

project_id str
The UUID of the project.

preserve_content bool
Keep the compose file on disk. Defaults to False.

Returns

dict[str, object]
Result of the delete operation.


start_project

Start (docker compose up) a project.

Internal API

SYNO.Docker.Project

Parameters

project_id str
The UUID of the project.

Returns

dict[str, object]
Result of the start operation.


stop_project

Stop (docker compose down) a project.

Internal API

SYNO.Docker.Project

Parameters

project_id str
The UUID of the project.

Returns

dict[str, object]
Result of the stop operation.


build_project

Build (docker compose build) images for a project.

Internal API

SYNO.Docker.Project

Parameters

project_id str
The UUID of the project.

Returns

dict[str, object]
Result of the build operation.


get_docker_logs

Get Docker daemon-level / global logs.
These are logs from the Docker engine itself, not from individual containers. Use get_logs() for per-container logs.

Internal API

SYNO.Docker.Log

Parameters

offset int
Pagination offset. Defaults to 0.

limit int
Maximum number of log entries to return. Defaults to 50.

sort_dir str
Sort direction ("ASC" or "DESC"). Defaults to "DESC".

keyword str
Keyword filter.

level str
Log level filter (e.g. "error", "warn").

Returns

dict[str, object]
Docker daemon log entries.


get_migrate_status

Get the migration status of Docker containers / configuration.
Checks whether containers require migration (e.g. after a DSM or Docker package upgrade).

Internal API

SYNO.Docker.Migrate

Returns

dict[str, object]
Current migration status.


start_migration

Start the Docker migration process.
Triggers migration of containers that require updating after a DSM or Docker package upgrade.

Internal API

SYNO.Docker.Migrate

Returns

dict[str, object]
Result of the migration start.


get_docker_utils_info

Get Docker utility information.
Returns general Docker engine information such as version, storage driver, volumes path, and capability flags.

Internal API

SYNO.Docker.Utils

Returns

dict[str, object]
Docker engine utility information.


docker_prune

Prune unused Docker resources.
Removes unused containers, networks, images, and build cache (equivalent to docker system prune).

Internal API

SYNO.Docker.Utils

Returns

dict[str, object]
Result of the prune operation, including space reclaimed.


get_docker_version

Get Docker engine version information.

Internal API

SYNO.Docker.Utils

Returns

dict[str, object]
Docker version details (version, API version, go version, etc.).