chatbot/buildx.sh

22 lines
636 B
Bash
Raw Permalink Normal View History

2022-09-03 11:12:05 +03:00
#!/bin/bash
echo "Welcome!"
2022-09-03 11:28:28 +03:00
version="1.0.1"
platform="linux/amd64,linux/arm64"
2022-11-21 19:57:05 +02:00
localRegistryPass="**********"
databaseConnection="#########"
2022-09-03 11:12:05 +03:00
echo "Login to alpine-nexus registry."
docker login --username=admin --password=$localRegistryPass alpine-nexus:8500
echo "Create docker image with version $version for platform $platform"
docker buildx build \
--build-arg APP_VERSION=$version \
2022-11-21 19:57:05 +02:00
--build-arg DATABASE_CONNECTION=$databaseConnection \
2022-09-03 11:12:05 +03:00
--platform $platform \
--output=type=image,push=true,registry.insecure=true \
--push \
--tag alpine-nexus:8500/chatbot/chatbot-api:$version \
-f "Chatbot.Api/Dockerfile" .
echo "Done!"