#!/bin/bash # Loop through each directory in the builds directory for dir in builds/*/ ; do # Remove trailing slash from directory name dir=${dir%/} # Extract the folder name folder_name=$(basename $dir) # Build the Docker image docker buildx build --push --platform linux/amd64,linux/arm64 -t linloir/caddy-$folder_name $dir done