Update docker-vm.sh

This commit is contained in:
CanbiZ 2025-09-30 14:16:47 +02:00
parent 0810f49aac
commit 1dca949dfc

View File

@ -437,19 +437,16 @@ fi
if [[ "$INSTALL_MODE" = "cloudinit" ]]; then if [[ "$INSTALL_MODE" = "cloudinit" ]]; then
msg_info "Preparing Cloud-Init user-data for Docker (${CODENAME})" msg_info "Preparing Cloud-Init user-data for Docker (${CODENAME})"
if ! pick_snippet_storage; then # Use SNIPPET_STORE selected earlier
msg_error "No storage with snippets support available. Please enable 'Snippets' on at least one dir storage (e.g. local)." SNIPPET_DIR="$(pvesm path "$SNIPPET_STORE")/snippets"
exit 1
fi
mkdir -p "$SNIPPET_DIR" mkdir -p "$SNIPPET_DIR"
SNIPPET_FILE="docker-${VMID}-user-data.yaml" SNIPPET_FILE="docker-${VMID}-user-data.yaml"
SNIPPET_PATH="${SNIPPET_DIR}/${SNIPPET_FILE}" SNIPPET_PATH="${SNIPPET_DIR}/${SNIPPET_FILE}""
DOCKER_GPG_B64="$(curl -fsSL "${DOCKER_BASE}/gpg" | gpg --dearmor | base64 -w0)" DOCKER_GPG_B64="$(curl -fsSL "${DOCKER_BASE}/gpg" | gpg --dearmor | base64 -w0)"
cat >"$SNIPPET_PATH" <<EOYAML
cat >"$SNIPPET_PATH" <<EOYAML
#cloud-config #cloud-config
hostname: ${HN} hostname: ${HN}
manage_etc_hosts: true manage_etc_hosts: true