empty Dockerfile

This commit is contained in:
Shihaam Abdul Rahman 2023-10-06 01:36:20 +05:00
parent 0b2254336c
commit 82e2cc3167
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

View File

@ -131,14 +131,19 @@ build(){
platform=$(yq e ".services.$service.platform" "$file")
image=$(yq e ".services.$service.image" "$file")
build=$(yq e ".services.$service.build" "$file")
context=$(yq e ".services.$service.build.context" "$file")
dockerfile=$(yq e ".services.$service.build.dockerfile" "$file")
# Replace '/' and ':' with '-' in the platform string to make it suitable for a tag
platform_tag=$(echo "$platform" | tr '/:' '-')
# Append platform information to the image tag
new_image_tag="${image}-${platform_tag}"
$engine buildx build --platform $platform -t $new_image_tag -f $context/$dockerfile $context
# If dockerfile is null or empty, set it to "Dockerfile"
if [ -z "$dockerfile" ]; then
dockerfile="Dockerfile"
fi
$engine buildx build --platform $platform -t $new_image_tag -f $context$dockerfile $context
done
}
#push(){