Remove handling of Docker key.json (#4361)

The deprecated-key-path option is no longer handled, but it doesn't cause
problems because the key is explicitly ignored. It was completely removed in
Docker 19.03.0 [1].

As such, the option and the pre-start script to fix the corrupted key.json can
be removed now, as it has no effect, only printing confusing message when
Docker service fails to start.

[1] 98fc09128b
This commit is contained in:
Jan Čermák 2025-10-28 18:36:57 +01:00 committed by GitHub
parent af9131cd10
commit 31f347ee0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 0 additions and 13 deletions

View File

@ -4,6 +4,5 @@
"tag": "{{.Name}}"
},
"data-root": "/mnt/data/docker",
"deprecated-key-path": "/mnt/overlay/etc/docker/key.json",
"bip": "172.30.232.1/23"
}

View File

@ -3,4 +3,3 @@ FailureAction=reboot
[Service]
ExecStartPre=/usr/libexec/docker-disk-check
ExecStopPost=/usr/libexec/docker-failure

View File

@ -1,11 +0,0 @@
#!/bin/sh
if [ "$SERVICE_RESULT" = "exit-code" ] && [ "$EXIT_STATUS" = "1" ]; then
echo "Docker exited with exit status 1, this might be caused by corrupted key.json."
size=$(stat -c %s "/mnt/overlay/etc/docker/key.json")
echo "key.json: ${size} bytes"
if ! jq -e < "/mnt/overlay/etc/docker/key.json" > /dev/null || [ "${size}" -eq 0 ]; then
echo "key.json appears to be corrupted, it is not parsable. Removing it."
rm -f "/mnt/overlay/etc/docker/key.json"
fi
fi