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:8080is 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.shhas been replaced by 69 small test cases undertests/cases/, one per behavior, with shared setup intests/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
- fix(recreate): quote hint args, keep host IP and read-only mounts (#125) by @gundestrup in #127
- test: split the regression suite into focused cases by @telnetaisha in #126
New Contributors
- @telnetaisha made their first contribution in #126
Full Changelog: 3.1...3.1.1