Update build and run scripts to support Apple's container.

This commit is contained in:
2025-12-21 23:59:00 +01:00
parent 5162b183bf
commit 4ff0a7205f
2 changed files with 35 additions and 25 deletions

View File

@@ -1,17 +1,14 @@
#!//usr/bin/env bash
IMAGE_NAME="azure-image-chooser"
#IMAGE="docker.io/skoszewski/$IMAGE_NAME"
IMAGE="skdomlab.azurecr.io/$IMAGE_NAME"
IMAGE="docker.io/skoszewski/$IMAGE_NAME:latest"
# IMAGE="skdomlab.azurecr.io/$IMAGE_NAME"
if [ ! -z "$(command -v docker)" ] && [ "$(basename $(command -v docker))" = "docker" ]; then
CMD="docker"
elif [ ! -z "$(command -v podman)" ] && [ "$(basename $(command -v podman))" = "podman" ]; then
CMD="podman"
if command -v docker > /dev/null; then
docker buildx build -t $IMAGE app
elif command -v container > /dev/null; then
container build -t $IMAGE app
else
echo "No suitable container tool found"
exit 1
fi
$CMD build --platform=linux/amd64 -t $IMAGE app
$CMD push $IMAGE
fi