azure-pipelines-agent: Alpine: dependencies is missing for Dotnet Core

Azure pipelines agent (VSTS/TFS Agent) failed to start at dotnet:alpine images.

I tried different combination of alpine3.7+ image with dotnet2.1.4 or even 3.0 Each time run-time stuck because of dotnet dependencies issue:

su -c /agent/config.sh vsts-user

ldd: cannot load ./bin/libcoreclr.so: No such file or directory
ldd: cannot load ./bin/System.Security.Cryptography.Native.OpenSsl.so: No such file or directory
ldd: cannot load ./bin/System.IO.Compression.Native.so: No such file or directory
ldd: cannot load ./bin/System.Net.Http.Native.so: No such file or directory
Libicu's dependencies is missing for Dotnet Core 2.0
Execute ./bin/installdependencies.sh to install any missing Dotnet Core 2.0 dependencies.

/agent/bin/installdependencies.sh

--------OS Information--------
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.8.0
PRETTY_NAME="Alpine Linux v3.8"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"
------------------------------

/agent/bin/installdependencies.sh: line 182: [: ==: unary operator expected
Can't detect current OS type base on /etc/os-release.
Can't install dotnet core dependencies.
You can manually install all required dependencies base on follwoing documentation
https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x

Dockerfile

#FROM microsoft/dotnet:2.1.4-runtime-alpine3.7
#FROM microsoft/dotnet:2.1.4-runtime-deps-alpine3.7
#FROM microsoft/dotnet:2.1.4-aspnetcore-runtime-alpine3.7

FROM microsoft/dotnet-nightly:3.0-runtime-alpine
MAINTAINER rjudin (lifeci)

#perisstent install
RUN  apk update; apk --update add \
     curl git \
     jq icu-libs libcurl \
     libunwind~=1.2 \
     netcat-openbsd~=1.130 \
     sudo~=1.8 bash~=4.4 \
     openssl
     #ca-certificates;

#temp install
RUN apk --update add --virtual build-dependencies

#temp install cleaning
RUN apk del build-dependencies; \
     rm -rf /var/cache/apk/*

#ARG VSTS_AGENT_VERSION='2.131.0'
ARG VSTS_AGENT_VERSION='2.140.0'
ARG VSTS_AGENT_URL="https://vstsagentpackage.azureedge.net/agent/${VSTS_AGENT_VERSION}/vsts-agent-linux-x64-${VSTS_AGENT_VERSION}.tar.gz"

RUN echo "VSTS_AGENT_URL is $VSTS_AGENT_URL"

RUN set -x \
 && curl -fSL $VSTS_AGENT_URL -o agent.tgz \
 && mkdir agent \
 && cd agent \
 && tar -xz --no-same-owner -f ../agent.tgz \
 && cd .. \
 && rm agent.tgz

COPY ./start-vsts.sh .
RUN chmod +x start-vsts.sh

RUN adduser vsts-user; mkdir /vsts; chown -R vsts-user:root /vsts;
#USER vsts-user
RUN ls -la /vsts; whoami

CMD ["./start-vsts.sh"]

Related (closed) issues: https://github.com/Microsoft/azure-pipelines-agent/issues/1319 https://github.com/dotnet/core/issues/226

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Hi @vtbassmatt I am getting this error while I am using the steps here https://docs.microsoft.com/en-gb/azure/devops/pipelines/agents/docker?view=azure-devops with Alpine as base image

Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by ./bin/libcoreclr.so)
Error relocating ./bin/libcoreclr.so: __finite: symbol not found
Error relocating ./bin/libcoreclr.so: __isnan: symbol not found
Error relocating ./bin/libcoreclr.so: __finitef: symbol not found
Error relocating ./bin/libcoreclr.so: __isnanf: symbol not found
Error relocating ./bin/libcoreclr.so: pthread_attr_setaffinity_np: symbol not found
Error relocating ./bin/System.Net.Http.Native.so: __strdup: symbol not found
libicu's dependencies missing for .NET Core 3.1
Execute ./bin/installdependencies.sh to install any missing dependencies.

Any workaround to fix this ?