1
0
mirror of https://github.com/jakeswenson/BitBetter.git synced 2023-10-10 13:36:57 +02:00

Build licenseGen in Docker

This way we don't have to install dotnet sdk on the host
This commit is contained in:
Vinrobot 2019-07-05 20:29:22 +02:00
parent 7aa9b08d45
commit c97df32b0d
No known key found for this signature in database
GPG Key ID: 20207D962D63DD48
3 changed files with 16 additions and 11 deletions

View File

@ -1,5 +1,16 @@
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 as build
WORKDIR /licenseGen
COPY . /licenseGen
RUN dotnet add package Newtonsoft.Json --version 12.0.1 \
&& dotnet restore \
&& dotnet publish
FROM bitbetter/api
COPY bin/Debug/netcoreapp2.0/publish/* /app/
COPY --from=build /licenseGen/bin/Debug/netcoreapp2.0/publish/* /app/
ENTRYPOINT [ "dotnet", "/app/licenseGen.dll", "--core", "/app/Core.dll", "--cert", "/cert.pfx" ]
ENTRYPOINT [ "dotnet", "/app/licenseGen.dll", "--core", "/app/Core.dll", "--cert", "/cert.pfx" ]

View File

@ -1,11 +1,5 @@
#!/bin/bash
script_dir=`cd $(dirname $0); pwd`
cd "$script_dir"
dotnet restore
dotnet publish
docker build . -t bitbetter/licensegen # --squash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
docker build -t bitbetter/licensegen "$DIR" # --squash

View File

@ -14,5 +14,5 @@ elif [ "$#" -ge "2" ]; then
shift
fi
docker run -it -v "$cert_path:/cert.pfx" bitbetter/licensegen "$@"
docker run -it --rm -v "$cert_path:/cert.pfx" bitbetter/licensegen "$@"