athome/scripts/docker-push.sh

21 lines
570 B
Bash
Executable File

#!/bin/sh
TAG=$(git branch | grep "*" | awk '{ print $2 }')
LOCAL_IMAGE="athome"
REGISTRY="mos4"
REMOTE_IMAGE="athome"
DOCKERFILE="./Dockerfile"
echo "DOCKERFILE: $DOCKERFILE"
echo "TAG: $TAG"
echo "LOCAL_IMAGE: $LOCAL_IMAGE"
echo "REGISTRY: $REGISTRY"
echo "REMOTE_IMAGE: $REMOTE_IMAGE"
#docker buildx build --platform linux/amd64,linux/arm64 -f ${DOCKERFILE} -t \
# ${REGISTRY}/${REMOTE_IMAGE}:${TAG} . --push
docker buildx build --platform linux/amd64 -f ${DOCKERFILE} \
-t ${REGISTRY}/${REMOTE_IMAGE}:${TAG} \
-t ${REGISTRY}/${REMOTE_IMAGE}:latest . --push