.Net Core ignores DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable

It seems to be visible that you can save time building .NET Core by setting an environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true

. I find this is not the case for CentOS 7 and Debian Jessie Linux distributions.

I have a Jenkins slavers Docker image used by Jenkins to create .NET Core services, my image tag jenkins.slave.dotnet.image

.

The Docker plugin Jenkins uses jenkins.slave.dotnet.image

to deploy the slave container when starting a build. The Docker Jenkins plugin has access to the Docker host where it resides jenkins.slave.dotnet.image

.

In the Dockerfile for mine, jenkins.slave.dotnet.image

I set the environment parameters like this:

ENV NUGET_XMLDOC_MODE skip
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE true

      

Everything works fine except environment variables are ignored by commands dotnet

, see Jenkins build output for .NET Core service, you shouldn't see outlined text in image if environment variable is DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true

checked against dotnet

cmds:

enter image description here

Connecting ( docker exec -it jenkins.slave.dotnet.container bash

) to the container it is used in jenkins.slave.dotnet.image

, you can see that DOTNET_SKIP_FIRST_TIME_EXPERIENCE is correctly set to "true":

enter image description here

Dotnet -info output:

enter image description here

Here is my Dockerfile for my Jenkins Slave Docker image ( jenkins.slave.dotnet.image

) that my Jenkins master runs containers to create .NET Core Builds ( this is the environment I dotnet publish -c Debug -v m

run in
):

FROM tsl.devops.jenkins.slave.basic.docker.image
MAINTAINER Brian Ogden

#############################################
# .NET Core SDK
#############################################
RUN yum install -y \
    libunwind \
    libicu

RUN curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=848821
RUN mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet
RUN ln -s /opt/dotnet/dotnet /usr/local/bin

#add Trade Service Nuget Server
RUN mkdir -p /home/jenkins/.nuget/NuGet
COPY /files/NuGet.Config /home/jenkins/.nuget/NuGet/NuGet.Config

RUN chown -R jenkins /home/jenkins/.nuget
RUN chgrp -R jenkins /home/jenkins/.nuget

RUN chmod 600 /home/jenkins/.nuget/NuGet/NuGet.Config
RUN chmod 700 /home/jenkins/.nuget/NuGet

#speed up dotnet core builds
ENV NUGET_XMLDOC_MODE skip
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE true
#############################################

      

Here is an example .NET Core Micro Service build artifact that builds in the Jenkins Slave Docker environment that I just shared above:

FROM tsl.devops.dotnetcore.base.image
MAINTAINER Brian Ogden

#############################################
# .NET Service setup
#############################################
ARG ASPNETCORE_ENVIRONMENT

WORKDIR /app
COPY ./src/TSL.Bom.Service/bin/Debug/netcoreapp1.1/publish .

ENV ASPNETCORE_URLS http://+:5001
ENV ASPNETCORE_ENVIRONMENT $ASPNETCORE_ENVIRONMENT 

EXPOSE 5001

ENTRYPOINT ["dotnet", "TSL.Bom.Service.dll"]
#############################################

      

+3


source to share





All Articles