Fix DNS in install script chroot
Copy host /etc/resolv.conf into chroot before apk install. Set static nameserver after install for runtime. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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..."
|
||||
|
||||
Reference in New Issue
Block a user