From 9b1e465b83c15c47405a774d360ac207ad1a08be Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 10 Jun 2025 16:37:02 +0300 Subject: [PATCH] Update script to build and upload images --- scripts/deploy_to_docker.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/deploy_to_docker.sh b/scripts/deploy_to_docker.sh index 5e27d52..b49d29c 100755 --- a/scripts/deploy_to_docker.sh +++ b/scripts/deploy_to_docker.sh @@ -22,20 +22,21 @@ docker_tag="${version:1}" echo "Creating git tag: $version" # git tag "$version" -# Build the docker image with the version tag -echo "Building docker image: chrisvel/tududi:$docker_tag" -docker build -t chrisvel/tududi:"$docker_tag" . +# Ensure buildx is available and setup a new builder if needed +echo "Setting up Docker buildx for multi-architecture builds" +docker buildx ls | grep -q mybuilder || docker buildx create --name mybuilder --use +docker buildx inspect --bootstrap -# Build the docker image with the latest tag -echo "Building docker image: chrisvel/tududi:latest" -docker build -t chrisvel/tududi:latest . +# Build and push multi-architecture images (ARM64 and AMD64) with the version tag +echo "Building and pushing multi-architecture docker image: chrisvel/tududi:$docker_tag" +docker buildx build --platform linux/amd64,linux/arm64 \ + -t chrisvel/tududi:"$docker_tag" \ + --push . -# Push the docker image with the version tag -echo "Pushing docker image: chrisvel/tududi:$docker_tag" -docker push chrisvel/tududi:"$docker_tag" +# Build and push multi-architecture images (ARM64 and AMD64) with the latest tag +echo "Building and pushing multi-architecture docker image: chrisvel/tududi:latest" +docker buildx build --platform linux/amd64,linux/arm64 \ + -t chrisvel/tududi:latest \ + --push . -# Push the docker image with the latest tag -echo "Pushing docker image: chrisvel/tududi:latest" -docker push chrisvel/tududi:latest - -echo "Deployment complete!" \ No newline at end of file +echo "Deployment complete!"