Add Alpine IronClaw CT template

Add a new Alpine-based container template for IronClaw. Introduces ct/alpine-ironclaw.sh (installer/launcher with update routine), ct/headers/alpine-ironclaw (ASCII header), install/alpine-ironclaw-install.sh (sets up PostgreSQL 17, pgvector, deploys MUSL prebuilt IronClaw binary, creates OpenRC service and env file), and json/alpine-ironclaw.json (metadata, docs link, ports, resource defaults). The template auto-generates a gateway auth token, uses the MUSL binary for a minimal footprint, and documents post-install steps (ironclaw onboard).
This commit is contained in:
CanbiZ (MickLesk)
2026-03-27 12:05:25 +01:00
parent 4f0ef8b001
commit 1e44478082
3 changed files with 147 additions and 0 deletions

69
ct/alpine-ironclaw.sh Normal file
View File

@@ -0,0 +1,69 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://github.com/nearai/ironclaw
APP="IronClaw"
var_tags="${var_tags:-ai;agent;alpine}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-alpine}"
var_version="${var_version:-3.23}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /usr/local/bin/ironclaw ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "ironclaw-bin" "nearai/ironclaw"; then
msg_info "Stopping Service"
rc-service ironclaw stop 2>/dev/null || true
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /root/.ironclaw/.env /root/ironclaw.env.bak
msg_ok "Backed up Configuration"
fetch_and_deploy_gh_release "ironclaw-bin" "nearai/ironclaw" "prebuild" "latest" "/usr/local/bin" \
"ironclaw-$(uname -m)-unknown-linux-musl.tar.gz"
chmod +x /usr/local/bin/ironclaw
msg_info "Restoring Configuration"
cp /root/ironclaw.env.bak /root/.ironclaw/.env
rm -f /root/ironclaw.env.bak
msg_ok "Restored Configuration"
msg_info "Starting Service"
rc-service ironclaw start
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access the Web UI at:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
echo -e "${INFO}${YW} Auth token and database credentials:${CL}"
echo -e "${TAB}${BGN}cat /root/.ironclaw/.env${CL}"
echo -e "${INFO}${YW} Configure your LLM provider with:${CL}"
echo -e "${TAB}${BGN}ironclaw onboard${CL}"

View File

@@ -0,0 +1,6 @@
___ __ _ _____ ______
/ | / /___ (_)___ ___ / _/________ ____ ____/ ____/ ____ _ __
/ /| | / / __ \/ / __ \/ _ \ / // ___/ __ \/ __ \/ ___/ / / __ \ | /| / /
/ ___ |/ / /_/ / / / / / __/_/ // / / /_/ / / / / /__/ /___/ /_/ / |/ |/ /
/_/ |_/_/ .___/_/_/ /_/\___/___/_/ \____/_/ /_/\___/\____/\____/|__/|__/
/_/

View File

@@ -0,0 +1,72 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://github.com/nearai/ironclaw
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing PostgreSQL"
$STD apk add postgresql17 postgresql17-openrc postgresql-pgvector postgresql-common
rc-service postgresql setup >/dev/null 2>&1
rc-update add postgresql default >/dev/null 2>&1
$STD rc-service postgresql start
msg_ok "Installed PostgreSQL"
msg_info "Setting up Database"
PG_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
$STD su -s /bin/sh postgres -c "psql -c \"CREATE ROLE ironclaw WITH LOGIN PASSWORD '${PG_PASS}';\""
$STD su -s /bin/sh postgres -c "psql -c \"CREATE DATABASE ironclaw WITH OWNER ironclaw;\""
$STD su -s /bin/sh postgres -c "psql -d ironclaw -c \"CREATE EXTENSION IF NOT EXISTS vector;\""
msg_ok "Set up Database"
fetch_and_deploy_gh_release "ironclaw-bin" "nearai/ironclaw" "prebuild" "latest" "/usr/local/bin" \
"ironclaw-$(uname -m)-unknown-linux-musl.tar.gz"
chmod +x /usr/local/bin/ironclaw
msg_info "Configuring IronClaw"
mkdir -p /root/.ironclaw
GATEWAY_TOKEN=$(openssl rand -hex 32)
cat <<EOF >/root/.ironclaw/.env
DATABASE_URL=postgresql://ironclaw:${PG_PASS}@localhost:5432/ironclaw
GATEWAY_ENABLED=true
GATEWAY_HOST=0.0.0.0
GATEWAY_PORT=3000
GATEWAY_AUTH_TOKEN=${GATEWAY_TOKEN}
CLI_ENABLED=false
AGENT_NAME=ironclaw
RUST_LOG=ironclaw=info,tower_http=info
EOF
chmod 600 /root/.ironclaw/.env
msg_ok "Configured IronClaw"
msg_info "Creating Service"
cat <<EOF >/etc/init.d/ironclaw
#!/sbin/openrc-run
name="IronClaw"
description="IronClaw AI Agent"
command="/usr/local/bin/ironclaw"
command_background=true
pidfile="/run/ironclaw.pid"
directory="/root"
supervise_daemon_args="--env-file /root/.ironclaw/.env"
depend() {
need net postgresql
}
EOF
chmod +x /etc/init.d/ironclaw
rc-update add ironclaw default >/dev/null 2>&1
rc-service ironclaw start >/dev/null 2>&1
msg_ok "Created Service"
motd_ssh
customize