Skip to content

Commit 41a5126

Browse files
committed
Changed docker builds from localhost for 127.0.0.1 so it matches Docker's insecure registry defaults without requiring https
1 parent baebfbc commit 41a5126

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/actions/deploy.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ action_deploy() {
193193
# Set default values (can be overridden by .env file or command line arguments)
194194
registry_port="${SPIN_REGISTRY_PORT:-5080}"
195195
build_platform="${SPIN_BUILD_PLATFORM:-"linux/amd64"}"
196-
image_prefix="${SPIN_BUILD_IMAGE_PREFIX:-"localhost:$registry_port"}"
196+
image_prefix="${SPIN_BUILD_IMAGE_PREFIX:-"127.0.0.1:$registry_port"}"
197197
image_tag="${SPIN_BUILD_TAG:-$(date +%Y%m%d%H%M%S)}"
198198
ssh_port="${SPIN_SSH_PORT:-22}"
199199
ssh_user="${SPIN_SSH_USER:-"deploy"}"
@@ -286,7 +286,7 @@ action_deploy() {
286286
# Build SSH command with proper quoting
287287
ssh_cmd=(
288288
ssh -f -n -N
289-
-R "${registry_port}:localhost:${registry_port}"
289+
-R "${registry_port}:127.0.0.1:${registry_port}"
290290
-p "${ssh_port}"
291291
"${ssh_user}@${docker_swarm_manager}"
292292
-o ExitOnForwardFailure=yes
@@ -303,7 +303,7 @@ action_deploy() {
303303
echo " 🔌 Remote port: ${registry_port}"
304304
echo " 👤 SSH user: ${ssh_user}"
305305
echo " 🔢 SSH port: ${ssh_port}"
306-
echo "${BOLD}${BLUE}🔄 The tunnel will forward connections from the remote port ${registry_port} to localhost:${registry_port}${RESET}"
306+
echo "${BOLD}${BLUE}🔄 The tunnel will forward connections from the remote port ${registry_port} to 127.0.0.1:${registry_port}${RESET}"
307307
else
308308
ssh_exit_code=$?
309309
echo "${BOLD}${RED}❌ Failed to create SSH tunnel (Exit code: $ssh_exit_code)${RESET}"
@@ -313,7 +313,7 @@ action_deploy() {
313313
fi
314314

315315
# Get the process ID of the SSH tunnel using POSIX-compliant commands
316-
tunnel_pid=$(ps aux | grep "ssh -f -n -N -R ${registry_port}:localhost:${registry_port}" | grep -v grep | awk '{print $2}')
316+
tunnel_pid=$(ps aux | grep "ssh -f -n -N -R ${registry_port}:127.0.0.1:${registry_port}" | grep -v grep | awk '{print $2}')
317317

318318
echo "${BOLD}${BLUE}🚀 Deploying Docker stack...${RESET}"
319319
deploy_docker_stack "$docker_swarm_manager" "$ssh_port"

0 commit comments

Comments
 (0)