From 41a5126d2e0bbc2362576095fbe20c8ab7abb60c Mon Sep 17 00:00:00 2001 From: Jay Rogers Date: Tue, 17 Dec 2024 21:00:42 -0600 Subject: [PATCH] Changed docker builds from localhost for 127.0.0.1 so it matches Docker's insecure registry defaults without requiring https --- lib/actions/deploy.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/actions/deploy.sh b/lib/actions/deploy.sh index 9d915026..97925dfc 100755 --- a/lib/actions/deploy.sh +++ b/lib/actions/deploy.sh @@ -193,7 +193,7 @@ action_deploy() { # Set default values (can be overridden by .env file or command line arguments) registry_port="${SPIN_REGISTRY_PORT:-5080}" build_platform="${SPIN_BUILD_PLATFORM:-"linux/amd64"}" - image_prefix="${SPIN_BUILD_IMAGE_PREFIX:-"localhost:$registry_port"}" + image_prefix="${SPIN_BUILD_IMAGE_PREFIX:-"127.0.0.1:$registry_port"}" image_tag="${SPIN_BUILD_TAG:-$(date +%Y%m%d%H%M%S)}" ssh_port="${SPIN_SSH_PORT:-22}" ssh_user="${SPIN_SSH_USER:-"deploy"}" @@ -286,7 +286,7 @@ action_deploy() { # Build SSH command with proper quoting ssh_cmd=( ssh -f -n -N - -R "${registry_port}:localhost:${registry_port}" + -R "${registry_port}:127.0.0.1:${registry_port}" -p "${ssh_port}" "${ssh_user}@${docker_swarm_manager}" -o ExitOnForwardFailure=yes @@ -303,7 +303,7 @@ action_deploy() { echo " 🔌 Remote port: ${registry_port}" echo " 👤 SSH user: ${ssh_user}" echo " 🔢 SSH port: ${ssh_port}" - echo "${BOLD}${BLUE}🔄 The tunnel will forward connections from the remote port ${registry_port} to localhost:${registry_port}${RESET}" + echo "${BOLD}${BLUE}🔄 The tunnel will forward connections from the remote port ${registry_port} to 127.0.0.1:${registry_port}${RESET}" else ssh_exit_code=$? echo "${BOLD}${RED}❌ Failed to create SSH tunnel (Exit code: $ssh_exit_code)${RESET}" @@ -313,7 +313,7 @@ action_deploy() { fi # Get the process ID of the SSH tunnel using POSIX-compliant commands - tunnel_pid=$(ps aux | grep "ssh -f -n -N -R ${registry_port}:localhost:${registry_port}" | grep -v grep | awk '{print $2}') + tunnel_pid=$(ps aux | grep "ssh -f -n -N -R ${registry_port}:127.0.0.1:${registry_port}" | grep -v grep | awk '{print $2}') echo "${BOLD}${BLUE}🚀 Deploying Docker stack...${RESET}" deploy_docker_stack "$docker_swarm_manager" "$ssh_port"