Api docker buildx scripts
parent
463e43380e
commit
5415b78b8c
|
@ -46,7 +46,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{C5096F61-731
|
|||
ProjectSection(SolutionItems) = preProject
|
||||
build-amd64.sh = build-amd64.sh
|
||||
release.sh = release.sh
|
||||
build-arm32.sh = build-arm32.sh
|
||||
buildx-arm32.sh = buildx-arm32.sh
|
||||
buildx.sh = buildx.sh
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "agent", "agent", "{C04663A1-E0CD-41D6-A8D7-FADDF9DA8302}"
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
echo "Welcome!"
|
||||
|
||||
version="1.0.5"
|
||||
localRegistryPass="***REMOVED***"
|
||||
#platform="linux/amd64,linux/arm64"
|
||||
platform="linux/arm64"
|
||||
|
||||
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 image build --build-arg APP_VERSION=$version -t "network-resurrector-api:$version" -f "src/api/NetworkResurrector.Api/Docker/Dockerfile" .
|
||||
docker buildx build \
|
||||
--build-arg APP_VERSION=$version \
|
||||
--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!"
|
|
@ -1,18 +1,17 @@
|
|||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
ARG BASE_IMAGE_VERSION
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:$BASE_IMAGE_VERSION AS base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
|
||||
WORKDIR /src
|
||||
COPY dependencies.props .
|
||||
COPY Directory.Build.props .
|
||||
COPY NuGet.config .
|
||||
COPY ["src/api/NetworkResurrector.Api/NetworkResurrector.Api.csproj", "NetworkResurrector.Api/"]
|
||||
COPY ["src/api/NetworkResurrector.Api.Application/NetworkResurrector.Api.Application.csproj", "NetworkResurrector.Api.Application/"]
|
||||
COPY ["src/api/NetworkResurrector.Api.PublishedLanguage/NetworkResurrector.Api.PublishedLanguage.csproj", "NetworkResurrector.Api.PublishedLanguage/"]
|
||||
COPY ["src/api/NetworkResurrector.Api.Domain/NetworkResurrector.Api.Domain.csproj", "NetworkResurrector.Api.Domain/"]
|
||||
COPY ["src/api/NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj", "NetworkResurrector.Api.Domain.Data/"]
|
||||
RUN dotnet restore "NetworkResurrector.Api/NetworkResurrector.Api.csproj"
|
||||
|
@ -31,6 +30,11 @@ ENV urls="http://*:80"
|
|||
ENV ConnectionStrings__DatabaseConnection="***REMOVED***"
|
||||
ENV IdentityServer__BaseAddress="http://***REMOVED***/"
|
||||
ENV NetworkResurrectorServer__BaseAddress="http://***REMOVED***/"
|
||||
ENV TZ=Europe/Bucharest
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
ARG APP_VERSION=0.0.0.0
|
||||
ENV APP_VERSION=${APP_VERSION}
|
||||
|
||||
#Workaround to lower the TLS level in container for old sql server version
|
||||
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf
|
||||
|
|
Loading…
Reference in New Issue