Skip to content

Commit

Permalink
Normal
Browse files Browse the repository at this point in the history
  • Loading branch information
agustarnason committed Dec 11, 2024
1 parent 08ff091 commit d8ada7e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,16 @@ ARG FEED_ACCESSTOKEN

ENV DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
ENV NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED=true
# ENV NUGET_CREDENTIALPROVIDER_VSTS_TOKEN_PROVIDER=true
# ENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS="{\"endpointCredentials\": [{\"endpoint\":\"https://statoildeveloper.pkgs.visualstudio.com/_packaging/ProCoSysOfficial/nuget/v3/index.json\", \"username\":\"docker\", \"password\":\"${FEED_ACCESSTOKEN}\"}]}"
ENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS="{\"endpointCredentials\": [{\"endpoint\":\"https://statoildeveloper.pkgs.visualstudio.com/_packaging/ProCoSysOfficial/nuget/v3/index.json\", \"username\":\"docker\", \"password\":\"${FEED_ACCESSTOKEN}\"}]}"
RUN wget -qO- https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh | bash

RUN dotnet build "Equinor.ProCoSys.Completion.WebApi.csproj" -c Release

# Install Azure CLI in the Docker container
RUN apt-get update && apt-get install -y curl lsb-release apt-transport-https ca-certificates
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash

# Login to Azure using the service principal
RUN --mount=type=secret,id=AZURE_CLIENT_SECRET az login --service-principal \
-u $AZURE_CLIENT_ID \
-p $(cat /run/secrets/AZURE_CLIENT_SECRET) \
--tenant $AZURE_TENANT_ID

RUN dotnet restore "Equinor.ProCoSys.Completion.WebApi.csproj" --source "https://statoildeveloper.pkgs.visualstudio.com/_packaging/ProCoSysOfficial/nuget/v3/index.json"
RUN dotnet build "Equinor.ProCoSys.Completion.WebApi.csproj" -c Release
RUN --mount=type=secret,id=AZURE_CLIENT_SECRET az login --service-principal -u $AZURE_CLIENT_ID -p $(cat /run/secrets/AZURE_CLIENT_SECRET) --tenant $AZURE_TENANT_ID

# Publish the application
FROM build AS publish
Expand Down

0 comments on commit d8ada7e

Please sign in to comment.