Skip to content
Advertisement

.Net Core ignoring Environment Variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE

It seems apparent that you can save some time doing .NET Core builds by setting Environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true. I am finding this is not the case on CentOS 7 and Debian Jessie Linux distros.

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

The Jenkins Docker Plugin, uses jenkins.slave.dotnet.image to spin up a slave container when a build is triggered. The Jenkins Docker Plugin has access to a Docker host where the jenkins.slave.dotnet.image resides.

In the Dockerfile for my jenkins.slave.dotnet.image I set environment vars like so:

ENV NUGET_XMLDOC_MODE skip
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE true

All works fine, except those environment variables are being ignored by dotnet commands, see the output of a Jenkins build for a .NET Core service, you should not see the circled text in the image if environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true is being checked by dotnet cmds:

enter image description here

Connecting (docker exec -it jenkins.slave.dotnet.container bash) to a container that uses the jenkins.slave.dotnet.image you can see that DOTNET_SKIP_FIRST_TIME_EXPERIENCE is correctly set to “true”:

enter image description here

Output of dotnet –info:

enter image description here

Here is my Dockerfile for my Jenkins Slave Docker image (jenkins.slave.dotnet.image) that my Jenkins master runs containers of to do .NET Core Builds (this is the environment that dotnet publish -c Debug -v m is executed 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 of a .NET Core Micro Service build artifact that builds in the Jenkins Slave Docker environment 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"]
#############################################

Advertisement

Answer

Is replaced by DOTNET_NOLOGO.

Here you can find more about dotnet environment variables and here you can find the source code on Github.

Advertisement