Skip to content

Commit b8b7e84

Browse files
authored
Define SOLUTION_NAME as env variable (#6)
2 parents 5b84832 + f9ab8d5 commit b8b7e84

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

TemplateService/Dockerfile

+13-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,26 @@ COPY ./ ./
1010
ARG NUGET_API_KEY
1111
ARG SOLUTION_NAME
1212

13-
RUN dotnet nuget add source https://nuget.pkg.github.com/trumpee/index.json --name github --username trumpee --password $NUGET_API_KEY --store-password-in-clear-text
14-
RUN ls -alF && dotnet restore "$SOLUTION_NAME.sln" --source "https://api.nuget.org/v3/index.json" --source "https://nuget.pkg.github.com/trumpee/index.json"
13+
RUN dotnet nuget add source https://nuget.pkg.github.com/trumpee/index.json \
14+
--name github \
15+
--username trumpee \
16+
--password $NUGET_API_KEY \
17+
--store-password-in-clear-text
18+
19+
RUN dotnet restore "$SOLUTION_NAME.sln" \
20+
--source "https://api.nuget.org/v3/index.json" \
21+
--source "https://nuget.pkg.github.com/trumpee/index.json"
22+
1523
RUN dotnet build "$SOLUTION_NAME.sln" -c Release -o /app/build --no-restore
1624

1725
FROM build AS publish
1826
RUN dotnet publish "$SOLUTION_NAME.sln" -c Release -o /app/publish
1927

2028
FROM base AS final
29+
WORKDIR /app
30+
COPY --from=publish /app/publish .
2131

2232
ARG SOLUTION_NAME
33+
ENV SOLUTION_NAME=$SOLUTION_NAME
2334

24-
WORKDIR /app
25-
COPY --from=publish /app/publish .
2635
ENTRYPOINT ["dotnet", "$SOLUTION_NAME.dll"]

0 commit comments

Comments
 (0)