From 72a99d056a04a2ad2790ae7f9ed57ff4c0212bdb Mon Sep 17 00:00:00 2001 From: Sophie Date: Tue, 30 Dec 2025 10:38:11 +0100 Subject: [PATCH] fix: Address critical code review feedback from Gemini CRITICAL FIXES: 1. Restore multi-architecture support - Use ARG BUILD_FROM/BUILD_ARCH instead of hardcoded amd64 base image - Fixes: aarch64 builds were broken by hardcoded FROM ghcr.io/hassio-addons/base/amd64:11.1.0 - Now: FROM $BUILD_FROM allows alexbelgium build system to set correct base per architecture 2. Remove stderr suppression from agent command - Restore error visibility for debugging - Fixes: Error messages were hidden by 2>/dev/null redirection - Now: ./agent command output visible for user diagnostics These changes ensure: - Multi-arch builds work correctly (amd64, aarch64, armv7, armhf, i386) - Users can debug configuration issues via visible error logs - Circular dependency fix is fully compatible with existing build system --- portainer_agent/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/portainer_agent/Dockerfile b/portainer_agent/Dockerfile index 17c156ff3..934b1dd62 100644 --- a/portainer_agent/Dockerfile +++ b/portainer_agent/Dockerfile @@ -2,7 +2,9 @@ # Fix for: FATAL: PROTECTION MODE IS ENABLED! error when protection mode is OFF # Approach: Level 1 (standard bashio) + Level 2 (socket fallback) -FROM ghcr.io/hassio-addons/base/amd64:11.1.0 +ARG BUILD_FROM +ARG BUILD_ARCH +FROM $BUILD_FROM # Step 1: Replace bashio v0.17.5 with main branch for improved API error handling RUN rm -rf /usr/lib/bashio /usr/bin/bashio && \ @@ -96,7 +98,7 @@ bashio::log.info "Starting Portainer Agent" # Launch app cd /app || true if bashio::config.has_value 'PORTAINER_AGENT_ARGS'; then - ./agent "$PORTAINER_AGENT_ARGS" 2> /dev/null + ./agent "$PORTAINER_AGENT_ARGS" else ./agent fi