diff --git a/scripts/install.sh b/scripts/install.sh index f165d19..78ab6b4 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -280,6 +280,9 @@ else mkdir -p /tmp/agent-build-mnt sudo mount /tmp/agent-build.ext4 /tmp/agent-build-mnt || err "Failed to mount agent rootfs" + # Copy host DNS so chroot can resolve packages + sudo cp /etc/resolv.conf /tmp/agent-build-mnt/etc/resolv.conf + log "Installing Alpine packages (openssh, python3, podman, curl, jq, bash)..." log " This may take a minute..." sudo chroot /tmp/agent-build-mnt sh -c ' @@ -301,6 +304,8 @@ else echo "[storage]" > /etc/containers/storage.conf echo "driver = \"vfs\"" >> /etc/containers/storage.conf ' || err "Failed to install packages in chroot" + # Set static DNS for runtime + echo "nameserver 8.8.8.8" | sudo tee /tmp/agent-build-mnt/etc/resolv.conf > /dev/null ok "Alpine packages installed" log "Installing agent script and config..."