chatbot/build.sh

23 lines
747 B
Bash

#!/bin/bash
echo "Welcome!"
version="1.0.0"
localRegistryPass="***REMOVED***"
echo "Create docker image with version $version."
docker image build -t "chatbot-api:$version" -f "Chatbot.Api/Dockerfile" .
echo "Tag docker image with registry prefix."
docker tag chatbot-api:$version alpine-nexus:8500/chatbot/chatbot-api:$version
echo "Login to alpine-nexus registry."
docker login --username=admin --password=$localRegistryPass alpine-nexus:8500
echo "Push image alpine-nexus:8500/chatbot/chatbot-api:$version to registry."
docker push alpine-nexus:8500/chatbot/chatbot-api:$version
echo "Remove image alpine-nexus:8500/chatbot/chatbot-api:$version from local machine."
docker rmi alpine-nexus:8500/chatbot/chatbot-api:$version
echo "DONE!"