Refactor OCI image handling in oci-deploy.sh
This commit is contained in:
parent
dae69a6690
commit
3f490abff1
@ -98,7 +98,10 @@ if [[ -z "${OCI_IMAGE:-}" ]]; then
|
|||||||
5) OCI_IMAGE="ghcr.io/linkwarden/linkwarden:latest" ;;
|
5) OCI_IMAGE="ghcr.io/linkwarden/linkwarden:latest" ;;
|
||||||
6)
|
6)
|
||||||
read -r -p "Enter OCI image (e.g., ghcr.io/user/repo:tag): " OCI_IMAGE
|
read -r -p "Enter OCI image (e.g., ghcr.io/user/repo:tag): " OCI_IMAGE
|
||||||
[[ -z "$OCI_IMAGE" ]] && { msg_error "No image specified"; exit 1; }
|
[[ -z "$OCI_IMAGE" ]] && {
|
||||||
|
msg_error "No image specified"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
msg_error "Invalid choice"
|
msg_error "Invalid choice"
|
||||||
@ -271,11 +274,12 @@ fi
|
|||||||
# Create container
|
# Create container
|
||||||
msg_info "Creating container $VMID"
|
msg_info "Creating container $VMID"
|
||||||
|
|
||||||
PCT_CMD="pct create $VMID --ostemplate oci://$FULL_IMAGE"
|
# Build pct create command
|
||||||
|
PCT_CMD="pct create $VMID"
|
||||||
PCT_CMD+=" --hostname $CT_NAME"
|
PCT_CMD+=" --hostname $CT_NAME"
|
||||||
PCT_CMD+=" --cores $CORES"
|
PCT_CMD+=" --cores $CORES"
|
||||||
PCT_CMD+=" --memory $MEMORY"
|
PCT_CMD+=" --memory $MEMORY"
|
||||||
PCT_CMD+=" --rootfs ${STORAGE}:${DISK}"
|
PCT_CMD+=" --rootfs ${STORAGE}:${DISK},oci=${FULL_IMAGE}"
|
||||||
PCT_CMD+=" --unprivileged $UNPRIVILEGED"
|
PCT_CMD+=" --unprivileged $UNPRIVILEGED"
|
||||||
|
|
||||||
if [[ "$IP_MODE" == "static" && -n "$STATIC_IP" ]]; then
|
if [[ "$IP_MODE" == "static" && -n "$STATIC_IP" ]]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user