Robin Lindner
Robin Lindner
Explore posts from servers
CC#
Created by Robin Lindner on 1/10/2023 in #help
❔ Docker + .NET [open / unresolved]
Does only work with curl -x http://myproxy:3128 --proxy-user username@password -L https://myFeed/.../nuget/v3/index.json
10 replies
CC#
Created by Robin Lindner on 1/10/2023 in #help
❔ Docker + .NET [open / unresolved]
On the machine it works
10 replies
CC#
Created by Robin Lindner on 1/10/2023 in #help
❔ Docker + .NET [open / unresolved]
Have you ever worked behind a corporate proxy with NuGet, if so how?
10 replies
CC#
Created by Robin Lindner on 1/10/2023 in #help
❔ Docker + .NET [open / unresolved]
#20 237.2 /src/src/WIS.WebAPI.ApplicationServices/WIS.WebAPI.ApplicationServices.csproj : error NU1301: Unable to load the service index for source https://myfeed/.../nuget/v3/index.json. [/src/src/WIS.WebAPI.SharedServices/WIS.WebAPI.SharedServices.csproj]
#20 237.2 /src/src/WIS.WebAPI.ApplicationServices/WIS.WebAPI.ApplicationServices.csproj : error NU1301: Unable to load the service index for source https://myfeed/.../nuget/v3/index.json. [/src/src/WIS.WebAPI.SharedServices/WIS.WebAPI.SharedServices.csproj]
10 replies
CC#
Created by Robin Lindner on 1/10/2023 in #help
❔ Docker + .NET [open / unresolved]
@echo off
docker build . -t sharedservices:0.1.0 -f . --build-arg HTTP_PROXY=%HTTP_PROXY% --build-arg HTTPS_PROXY=%HTTPS_PROXY% --build-arg AZURE_DEVOPS_ACCESS_TOKEN=%AZURE_DEVOPS_ACCESS_TOKEN%
@echo off
docker build . -t sharedservices:0.1.0 -f . --build-arg HTTP_PROXY=%HTTP_PROXY% --build-arg HTTPS_PROXY=%HTTPS_PROXY% --build-arg AZURE_DEVOPS_ACCESS_TOKEN=%AZURE_DEVOPS_ACCESS_TOKEN%
10 replies
CC#
Created by Robin Lindner on 1/10/2023 in #help
❔ Docker + .NET [open / unresolved]
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG AZURE_DEVOPS_ACCESS_TOKEN

ENV HTTP_PROXY ${HTTP_PROXY}
ENV HTTPS_PROXY ${HTTPS_PROXY}
ENV AZURE_DEVOPS_ACCESS_TOKEN ${AZURE_DEVOPS_ACCESS_TOKEN}

WORKDIR /src
COPY ["src/WIS.WebAPI.SharedServices/WIS.WebAPI.SharedServices.csproj", "src/WIS.WebAPI.SharedServices/"]
COPY ["src/WIS.WebAPI.ApplicationServices/WIS.WebAPI.ApplicationServices.csproj", "src/WIS.WebAPI.ApplicationServices/"]
COPY ["src/WIS.WebAPI.DataAccess/WIS.WebAPI.DataAccess.csproj", "src/WIS.WebAPI.DataAccess/"]
COPY ["src/WIS.WebAPI.Models/WIS.WebAPI.Models.csproj", "src/WIS.WebAPI.Models/"]
COPY ["src/WIS.StatusCodes/WIS.SharedServices.StatusCodes.csproj", "src/WIS.StatusCodes/"]
COPY ["src/WIS.WebAPI.Enums/WIS.WebAPI.SharedServices.Enums.csproj", "src/WIS.WebAPI.Enums/"]
COPY ["src/WIS.WebAPI.SharedServices.DTOs/WIS.WebAPI.SharedServices.DTOs.csproj", "src/WIS.WebAPI.SharedServices.DTOs/"]
COPY ["src/WIS.WebAPI.Validators/WIS.WebAPI.Validators.csproj", "src/WIS.WebAPI.Validators/"]

RUN dotnet nuget add source -n wisfeed -u unused -p ${AZURE_DEVOPS_ACCESS_TOKEN} --valid-authentication-types basic --store-password-in-clear-text "https://myFeed/.../nuget/v3/index.json" \
&& dotnet nuget enable source wisfeed
RUN echo ${HTTP_PROXY} - ${AZURE_DEVOPS_ACCESS_TOKEN}
RUN dotnet restore "src/WIS.WebAPI.SharedServices/WIS.WebAPI.SharedServices.csproj"
COPY . .
WORKDIR "/src/src/WIS.WebAPI.SharedServices"
RUN dotnet build "WIS.WebAPI.SharedServices.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "WIS.WebAPI.SharedServices.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WIS.WebAPI.SharedServices.dll"]
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG AZURE_DEVOPS_ACCESS_TOKEN

ENV HTTP_PROXY ${HTTP_PROXY}
ENV HTTPS_PROXY ${HTTPS_PROXY}
ENV AZURE_DEVOPS_ACCESS_TOKEN ${AZURE_DEVOPS_ACCESS_TOKEN}

WORKDIR /src
COPY ["src/WIS.WebAPI.SharedServices/WIS.WebAPI.SharedServices.csproj", "src/WIS.WebAPI.SharedServices/"]
COPY ["src/WIS.WebAPI.ApplicationServices/WIS.WebAPI.ApplicationServices.csproj", "src/WIS.WebAPI.ApplicationServices/"]
COPY ["src/WIS.WebAPI.DataAccess/WIS.WebAPI.DataAccess.csproj", "src/WIS.WebAPI.DataAccess/"]
COPY ["src/WIS.WebAPI.Models/WIS.WebAPI.Models.csproj", "src/WIS.WebAPI.Models/"]
COPY ["src/WIS.StatusCodes/WIS.SharedServices.StatusCodes.csproj", "src/WIS.StatusCodes/"]
COPY ["src/WIS.WebAPI.Enums/WIS.WebAPI.SharedServices.Enums.csproj", "src/WIS.WebAPI.Enums/"]
COPY ["src/WIS.WebAPI.SharedServices.DTOs/WIS.WebAPI.SharedServices.DTOs.csproj", "src/WIS.WebAPI.SharedServices.DTOs/"]
COPY ["src/WIS.WebAPI.Validators/WIS.WebAPI.Validators.csproj", "src/WIS.WebAPI.Validators/"]

RUN dotnet nuget add source -n wisfeed -u unused -p ${AZURE_DEVOPS_ACCESS_TOKEN} --valid-authentication-types basic --store-password-in-clear-text "https://myFeed/.../nuget/v3/index.json" \
&& dotnet nuget enable source wisfeed
RUN echo ${HTTP_PROXY} - ${AZURE_DEVOPS_ACCESS_TOKEN}
RUN dotnet restore "src/WIS.WebAPI.SharedServices/WIS.WebAPI.SharedServices.csproj"
COPY . .
WORKDIR "/src/src/WIS.WebAPI.SharedServices"
RUN dotnet build "WIS.WebAPI.SharedServices.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "WIS.WebAPI.SharedServices.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WIS.WebAPI.SharedServices.dll"]
10 replies
CC#
Created by Robin Lindner on 9/27/2022 in #help
NuGet behind a proxy
as you see the env does not work 😄
6 replies
CC#
Created by Robin Lindner on 9/27/2022 in #help
NuGet behind a proxy
6 replies
CC#
Created by Robin Lindner on 9/9/2022 in #help
LINQ Lambda-Expression Diff
nope
7 replies
CC#
Created by Robin Lindner on 9/9/2022 in #help
LINQ Lambda-Expression Diff
readability? why wouldn't you use it?
7 replies