Laser42
Laser42

Reputation: 754

dotnet coverage (test) raises No usable version of libssl was found

I have a solution which contains one .NET Core 3.1 project, and some .NET 6 and 8 projects. I need an universal docker image containing .NET SDK (3.1, 6, 8) to run dotnet coverage with dotnet test inside. So, I made the image:

# Use .NET 8 SDK
FROM nx-docker-microsoft-proxy.alfastrah.ru/dotnet/sdk:8.0

# Some installs & upgrades
RUN apt-get update \
    && apt-get install -y ca-certificates openssl \
    && rm -rf /var/lib/apt/lists/*

#.NET SDKs 3.1 Core & 6
RUN wget --no-check-certificate https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh \
    && chmod +x dotnet-install.sh \
    && ./dotnet-install.sh --channel 3.1 --install-dir /usr/share/dotnet \
    && ./dotnet-install.sh --channel 6.0 --install-dir /usr/share/dotnet \
    && rm dotnet-install.sh

The Gitlab CI job which runs coverage & tests:

test-dotnet:
  #...
  artifacts:    
    paths:
      - $DOTNET_COVERAGE_REPORT_PATH
  script:
    - apt-get update
    - apt-get install libxml2
    - dotnet nuget disable source nuget.org    
    - dotnet tool install dotnet-coverage --global --version 17.9.6 --add-source $MY_NUGET_SRC --ignore-failed-sources
    - export PATH="$PATH:$HOME/.dotnet/tools"
    - export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
    - dotnet build --source $MY_NUGET_SRC -c $DOTNET_CONFIG -m:1
    - dotnet-coverage collect "dotnet test --no-build --no-restore -c $DOTNET_CONFIG -m:1" -f xml -o $DOTNET_COVERAGE_REPORT_PATH

So, during this job I receive an error:

$ dotnet-coverage collect "dotnet test --no-build --no-restore -c $DOTNET_CONFIG -m:1" -f xml -o $DOTNET_COVERAGE_REPORT_PATH
Microsoft (R) Code Coverage Command Line Tool (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
SessionId: a2a47082-1ee3-4ca0-8437-1728917246eb
No usable version of libssl was found
/usr/bin/bash: line 195:   340 Aborted                 (core dumped) dotnet-coverage collect "dotnet test --no-build --no-restore -c $DOTNET_CONFIG -m:1" -f xml -o $DOTNET_COVERAGE_REPORT_PATH
Cleaning up file based variables
ERROR: Job failed: command terminated with exit code 1

also I tried to install libssl_dev like adviced in the web. The same result. How can i solve this error?

Upvotes: 3

Views: 389

Answers (1)

Black Monk
Black Monk

Reputation: 101

I have faced the above problem about running selfcontained .net5 app in ubuntu 18 docker. As to me, I think that you can beat it using following commands in container build:

apt-get update && apt-get install libssl1.1 -y

Upvotes: 0

Related Questions