network-resurrector/solution items/scripts/api/buildx.sh

26 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/bash
echo "Welcome!"
version="1.0.7"
platform="linux/amd64,linux/arm64"
localRegistryPass="***********"
databaseConnection="Server=#########;Database=#########;uid=#########;Password=#########;MultipleActiveResultSets=true"
identityServerBaseAddress="http://<hostname>:<port>/"
networkResurrectorServerBaseAddress="http://<hostname>:<port>/"
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 \
--build-arg DATABASE_CONNECTION=$databaseConnection \
--build-arg IDENTITY_SERVER_BASE_ADDRESS=$identityServerBaseAddress \
--build-arg NETWORK_RESURRECTOR_SERVER_BASE_ADDRESS=$networkResurrectorServerBaseAddress \
--platform $platform \
--output=type=image,push=true,registry.insecure=true \
--push \
--tag alpine-nexus:8500/network-resurrector/network-resurrector-api:$version \
-f "src/api/NetworkResurrector.Api/Docker/amd64/Dockerfile" .
echo "Done!"