Skip to content

Commit

Permalink
Ensure .NET Core runtimes are install in alpine builds to tests can run
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate McMaster committed Jul 3, 2018
1 parent 5717594 commit a7811c5
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build/SharedFx.targets
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@

<Target Name="BuildSharedFx" DependsOnTargets="GeneratePropsFiles;ResolveSharedFxFiles;CrossGenAssemblies;CrossGenSymbols;PackSharedFx;TestSharedFx"/>

<Target Name="TestSharedFx" DependsOnTargets="DefineSharedFxPrerequisites;ResolveCommitHash">
<Target Name="TestSharedFx" DependsOnTargets="GeneratePropsFiles;DefineSharedFxPrerequisites;ResolveCommitHash;InstallDotNet">
<PropertyGroup>
<UnitTestFxProject>$(RepositoryRoot)\test\SharedFx.UnitTests\SharedFx.UnitTests.csproj</UnitTestFxProject>
<UnitTestFxTestProps>
Expand Down
11 changes: 0 additions & 11 deletions build/docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,3 @@ ENV LANG en_US.UTF-8

# Skip package initilization
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1

# Workarounds https://github.com/dotnet/cli/issues/8738
ENV DOTNET_INSTALL_SKIP_PREREQS=1
ENV KOREBUILD_SKIP_RUNTIME_INSTALL=1

COPY global.json /tmp/global.json
RUN DOTNET_SDK_VERSION="$(jq -r '.sdk.version' /tmp/global.json)" \
&& echo "Installing SDK ${DOTNET_SDK_VERSION}" \
&& wget -q --tries 10 -O /tmp/dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-musl-x64.tar.gz \
&& mkdir -p "$HOME/.dotnet" \
&& tar xzf /tmp/dotnet.tar.gz -C "$HOME/.dotnet"
2 changes: 1 addition & 1 deletion build/repo.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<ItemGroup>
<!-- Explicitly require the 2.0.x and 2.1.0-* version of shared runtime used by universe -->
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp20PackageVersion)" />
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp20PackageVersion)" Condition="'$(SharedFXRid)' != 'linux-musl-x64'" />

<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp21PackageVersion)"
Feed="$(DotNetAssetRootUrl)"
Expand Down
7 changes: 0 additions & 7 deletions dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ fi
dockerfile="$DIR/build/docker/$image.Dockerfile"
tagname="universe-build-$image"

# Workaround for https://github.com/dotnet/cli/issues/8738 and https://github.com/Microsoft/msbuild/issues/3066
# Run noop target because we need to generate the global.json file so we can install the matching
# .NET Core SDK inside the Docker container.
"$DIR/build.sh" /t:Noop
cp "$DIR/global.json" "$(dirname "$dockerfile")"
#endworkaround

docker build "$(dirname "$dockerfile")" \
--build-arg "USER=$(whoami)" \
--build-arg "USER_ID=$(id -u)" \
Expand Down

0 comments on commit a7811c5

Please sign in to comment.