alexandrev-tibco 2025-08-30 09:09:18 +02:00
parent ad5ef9085c
commit 95489e69d9
1 changed files with 10 additions and 4 deletions

View File

@ -77,11 +77,17 @@ update_notes() {
echo "[ERROR] jq no está instalado; no se puede actualizar JSON de Docker." >&2
exit 1
fi
jq \
'\n (.hosts = ((.hosts // []) + ["unix:///var/run/docker.sock","tcp://0.0.0.0:2375"]) | .hosts |= unique)\n | .["metrics-addr"] = "0.0.0.0:9023"\n | .experimental = true\n ' "$DAEMON_JSON" > "$TMP_JSON"
JQF="/tmp/daemon_filter.jq"
cat > "$JQF" <<\JQ
(.hosts = ((.hosts // []) + ["unix:///var/run/docker.sock","tcp://0.0.0.0:2375"]) | .hosts |= unique)
| .["metrics-addr"] = "0.0.0.0:9023"
| .experimental = true
JQ
jq -f "$JQF" "$DAEMON_JSON" > "$TMP_JSON"
rm -f "$JQF"
else
echo "[INFO] Creando daemon.json con configuración por defecto (API TCP + métricas)."
cat > "$TMP_JSON" <<'JSON'
cat > "$TMP_JSON" <<\JSON
{
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"],
"metrics-addr": "0.0.0.0:9023",
@ -114,7 +120,7 @@ JSON
if [ $NEED_OVERRIDE -eq 1 ]; then
echo "[INFO] Creando override de systemd para remover -H fd:// y permitir hosts desde daemon.json"
cat > "$OVERRIDE" <<'OVR'
cat > "$OVERRIDE" <<\OVR
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd