Skip to content
Syno Package Land
Language: English

Container apps

The CLI turns an upstream Compose project into an SPK through one schema-2 dsm-package.yaml. Container Manager owns containers; the SDK owns identity and lifecycle.

Terminal window
synopkgland init -t compose --from ./compose.yaml my-app
synopkgland check --json
synopkgland build --arch x86_64
synopkgland inspect dist/MyApp-x86_64.spk --json

Import keeps upstream bytes and local include/extends/env dependencies. Review the detected ingress; an ambiguous port needs an explicit choice. Declare only the DSM differences:

<sdk-version> is a placeholder, not manifest syntax. synopkgland init copies compatible SDK pins from the locally installed templates. For a manual configuration, query npm view @synopackageland/sdk version, replace the placeholder with that exact release, and keep all App SDK declarations (including Go, Rust and frontend dependencies) aligned. Run synopkgland check with an up-to-date CLI before building.

schema: 2
package: MyApp
version: 0.1.0
build: 1
displayname: My App
description: Upstream application
maintainer: Example
os_min_ver: "7.2.1-69057"
arches: [x86_64, aarch64]
capabilities: {}
compose:
files: [compose.yaml]
env_files: [.env]
startup_timeout_seconds: 120
web: {service: web, port: 8080, health: {path: /health, status: 200}}
network: {egress: isolated}
identity_gateway:
sdk: <sdk-version>
mode: none
access: dsm-users
listen: {http: 28000}
ui: {launch: new-page}

Drop env_files when nothing is interpolated, and omit web and identity_gateway for a headless project. Field rules: Compose manifest.

compose.services.<service>.listener: {env: LISTEN, format: host-port} serves the nonroot host-network/OIDC topology: host-port supplies 127.0.0.1:<compose.web.port>, host only 127.0.0.1. Never combine it with address_env or override the variable upstream.

storage_init.runtime references package-generated OIDC secrets, writes private config files with exact replacements and runs a fixed argv; native ${VAR} stays literal. It does not make arbitrary images work without root, so verify paths, argv, readiness and data preservation on the target DSM.

compose.startup_timeout_seconds takes 2–900 seconds and defaults to 900, which a loaded NAS may need; lower it to fail faster. Adapters read the same value as SYNOPKGLAND_STARTUP_BUDGET_SECONDS; other lifecycle budgets use daemon.timeouts.

mode: none keeps native app login; header, token and embedded oidc use upstream interfaces and the DSM account bridge, with no SSO Server. DSM identity grants no file authority. Containers run as a fixed package identity and do not inherit the signed-in user’s File Station ACL: share settings decide visibility, and per-user access needs a File Station session or Broker Adapter.

For one existing Shared Folder:

capabilities: {composeMounts: true}
install:
sharedFolder: {mode: select, key: media, permission: ro}
compose:
shares:
media:
select: install
mounts: [{service: web, target: /media}]

The key and permission must match install.sharedFolder; omitted mount permission is ro, so declare rw in both for writes. Only mode: select works: package-account preinst resolves a unique non-symlink /volumeN source into the worker’s private .env. Mounted services run as the package UID:GID with all capabilities dropped and no-new-privileges.

Selection does not grant access: an administrator grants the package account access in Control Panel → Shared Folder → Edit → Permissions → System internal user. select: admin-after-install returns COMPOSE_PROJECT_CONTROL_UNAVAILABLE until protected ACL and project control are verified.

Declare GPU access instead of upstream devices mappings:

compose:
devices:
gpu:
services: [web]

The SDK maps only verified /dev/dri/renderD* devices read/write and adds the DSM videodriver GID through the native video-driver resource; no host root, wildcard mapping or cgroup rule is granted. Without a supported GPU the App starts with SYNOPKGLAND_GPU_STATUS=software and an empty SYNOPKGLAND_GPU_DEVICE; a mapped node reports available, which covers device mapping only, so probe the encoder. The declaration does not configure the transcoder.

compose.host_udp: [{port: 5353, purpose: mdns}] allows up to 32 unique UDP ports from 1024–65535 for the nonroot host web topology; undeclared non-loopback listeners stay rejected, and UDP does not satisfy web readiness.

Bind a required origin with install.settings.public_origin: {type: https-origin, label: Public HTTPS origin, required: true} and storage_init.runtime.environment.DOMAIN: {setting: public_origin}. The wizard validates a root HTTPS origin and the gateway port, keeps private mode-0600 state across upgrades and keep-data reinstall, and never ships the value in the SPK.

The gateway dials the container port on a dedicated internal bridge (sdk_ingress) at a package-derived fixed IPv4 address; every published port is removed, with no HAProxy helper, Docker socket or host root. Admission needs the health response, TCP connectivity and a current lifecycle acquire record, and fails closed otherwise. isolated blocks tested external IPv4/DNS but does not firewall host services or prove IPv6 isolation.

compose.network.ingress_candidate (0–255, default 0) picks a deterministic /29 from 10.128.0.0/9; an overlap fails with COMPOSE_SUBNET_CONFLICT, so choose another candidate and rebuild. Allocations survive upgrade, and Container Manager IPAM decides.

web.host_port is accepted but ignored. Existing .sc registrations need authorized cleanup or an official worker fix; a build does not delete them.

The gateway filters DSM id, did, _SSID, _CrPoSt, stay_login and the synopkgland_sso_ cookie namespace both ways, and rebuilds X-Forwarded-Host, X-Forwarded-Proto and X-Forwarded-Port from the validated public authority. Other cookie order and Set-Cookie attributes survive. Browser mutations and WebSocket upgrades need an exact Origin (or Referer) and SameSite cookies; upstream POST needs no SynoToken, but DSM’s authorization CGI still checks it.

WebSocket, SSE, streamed upload/download, Range, HEAD and redirects are covered. Upload overflow returns 413 with a 16 GiB default, and redirect rewriting preserves encoded paths, query and fragment.

Image-pull diagnostics classify TLS trust, DNS, connectivity, rate limits, disk space, missing images and denied access. ImageDiagnosis records a code, source, phase and time without bodies, URLs, credentials or log text. A read-only HTTPS /v2/ check covers at most four registries from locked references within five seconds, but reachability does not prove a pull; disk-space and image-specific causes need native failure evidence. Registry requests for image resolution and diagnosis reach public networks only: loopback, private, link-local and metadata addresses are refused, as is a DNS answer that mixes public and private addresses. Container Manager keeps its own rules for image pulls.

For a failed image install, fix the reported certificate/network, registry, storage or image-reference problem, then use Package Center → the App → Repair to rerun installation and download missing images. Start cannot repair a failed installation, and a larger startup budget does not help. On a startup timeout, read the phase code in daemon/daemon.log.

DSM 7.2.1 or later and Container Manager are required. Linux tests do not prove DSM worker behavior, storage ownership timing, bridge readback, ACL/revoke or egress enforcement; complete device acceptance against the final SPK digest. Primary Compose files and a multi-path include share one directory, overlays sit beside the primary file, and dependency paths stay inside the project root.

The reference loader merges upstream files and generated.override.yaml into one tag-free docker-compose.yml; the SPK keeps upstream bytes, the override, compose.lock.json and image metadata proofs. Build pins each platform image, and inspect replays the planner offline. Original wildcard ports are replaced.

FeatureBehavior
Local files, profiles, anchorsReference-loader semantics; remote/symlink dependencies rejected
Private binds, local named volumesCOMPOSE_PRIVATE_BIND_TIMING_UNSUPPORTED; use upstream named volumes
External volumesUnsupported
Run-asPackage UID/GID; container root needs a reason and no host bind
Build, hooks, sockets, devicesRejected; Intel render nodes use the declaration above

All lifecycle work runs as the package account; container root is separate from host elevation and visible in inspect, and a successful plan does not prove arbitrary-UID compatibility.

compose.lock.json records the project’s named volume keys and exact names in app_data, including image VOLUME storage. The uninstall wizard lists them and states they are kept even with delete-data, and the COMPOSE_DATA_RETAINED message in nine locales confirms it. Only explicit delete-data clears the package’s own data/config/home paths; upgrade, stop and keep-data never do.

The inventory comes from the planner without querying Docker: it is not a runtime existence check, omits volumes retired by older App versions, and needs no Docker socket. Back up named volumes separately; see Data and removal.