Skip to content
Snippets Groups Projects
Commit f22390ad authored by Johannes Buechele's avatar Johannes Buechele
Browse files

added script to build images

parent 1b6a6910
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Array of Dockerfile locations and their respective image names
dockerfiles=("deployments/dockerfiles/api-service.Dockerfile"
"deployments/dockerfiles/hashing-service.Dockerfile"
"deployments/dockerfiles/ipfs-service.Dockerfile"
"deployments/dockerfiles/post-registration-service.Dockerfile"
"deployments/dockerfiles/frontend-fairregister.Dockerfile")
imagetags=("registry.osalliance.com/faircommons/api-service"
"registry.osalliance.com/faircommons/hashing-service"
"registry.osalliance.com/faircommons/ipfs-service"
"registry.osalliance.com/faircommons/post-registration-service"
"registry.osalliance.com/faircommons/frontend-fairregister")
# Check if version is provided as argument
if [ -z "$1" ]; then
echo "Please provide version as an argument."
exit 1
fi
version=$1
# Loop over the array and build each image with the provided version tag
for index in ${!dockerfiles[*]}; do
echo "Building ${imagetags[$index]} with tag $version"
docker buildx build -f "${dockerfiles[$index]}" --platform linux/amd64 -t "${imagetags[$index]}:$version" -t "${imagetags[$index]}:latest" . --push
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment