github telnetdoogie-labs/synology-docker 3.1.1

3 hours ago

Highlights

A small follow-up to 3.1. The container recreation hints from syno_docker_list_containers.sh and container_recreate.sh are now safe to copy and paste, and they recreate containers more faithfully. The regression suite has also been split into small, focused test cases. Thanks to @gundestrup for the recreate fixes and @telnetaisha for the test split.

Container recreation hints

  • Every value is shell-quoted. The container name, each env value, ports, mounts, the image, and each command argument are quoted separately. Values with spaces or special characters such as $, ` or ; no longer break the copied command, and can't run anything when you paste it. Hints may look a little different as a result (for example, \ for a space).
  • Host IPs are kept on published ports. A port bound to 127.0.0.1:8080 is recreated as -p 127.0.0.1:8080:80/tcp, not opened on every interface. IPv6 bindings are kept too (for example, [::1]:5353:53/udp).
  • Read-only mounts stay read-only. Mounts that were read-only now get :ro.
  • Env values are still printed inline, now quoted. There's no env file to set up. Review the hint before sharing it, as it may contain secrets.

Tests

  • tests/workflows.sh has been replaced by 69 small test cases under tests/cases/, one per behavior, with shared setup in tests/lib/.
  • Run every case, or just one:
    docker build -t synology-docker-tests -f tests/Dockerfile .
    docker run --rm -v "$PWD:/workspace:ro" synology-docker-tests
    docker run --rm -v "$PWD:/workspace:ro" synology-docker-tests bash tests/run.sh container_recreate_preserves_port_bindings
  • The runner now runs every case and lists all failures at the end, and it refuses to run outside the throwaway test image.
  • The README has guidance on how new test cases should be written.
  • ShellCheck in CI now covers the test cases and shared test files.
  • Shell scripts and DSM test files are now always checked out with Unix (LF) line endings, so a Windows checkout no longer breaks them.

No updater scripts changed in the test split.

Known limitations

  • Recreation hints are still a best guess, not a full copy of the container. Ports published on a random host port are left out, and named volumes appear as their host path. For anything complex, use stateful-docker-migration-flow.
  • DSM 6 has still not been tested on physical hardware (#121).

What's Changed

New Contributors

Full Changelog: 3.1...3.1.1

Don't miss a new synology-docker release

NewReleases is sending notifications on new releases.