Issues deploying R 4.1.0 using mcr.microsoft.com/azure-functions/dotnet:4.0-appservice as base on my dockerfile

Francisco Cavaco 1 Reputation point
2022-11-08T09:47:17.61+00:00

Hello,

I'm facing some issues trying to install r-base & r-based-dev for the afore mentioned base image.

   FROM mcr.microsoft.com/azure-functions/dotnet:4.0-appservice   
   ENV AzureWebJobsScriptRoot=/home/site/wwwroot \  
       AzureFunctionsJobHost__Logging__Console__IsEnabled=true \  
       BbjiraPackage='bbjira_0.0.0.9016.tar.gz'  
     
   ENV R_BASE_VERSION 4.1.0  
     
   RUN echo "deb http://cloud.r-project.org/bin/linux/debian bullseye-cran40/" > /etc/apt/sources.list.d/cran.list  
   #RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-key '95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7'  
     
   RUN apt update \  
   	&& apt install -y --no-install-recommends \  
   		r-base=${R_BASE_VERSION}* \  
           r-base-core=${R_BASE_VERSION}* \  
   		r-base-dev=${R_BASE_VERSION}*  

result:

   #6 0.804   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B8F25A8A73EACF41  
   #6 1.380 Get:7 http://deb.debian.org/debian bullseye-updates/main amd64 Packages.diff/Index [15.1 kB]  
   #6 1.381 Ign:7 http://deb.debian.org/debian bullseye-updates/main amd64 Packages.diff/Index  
   #6 1.397 Get:8 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [14.6 kB]  
   #6 2.372 Reading package lists...  
   #6 2.831 W: GPG error: http://cloud.r-project.org/bin/linux/debian bullseye-cran40/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B8F25A8A73EACF41  
   #6 2.831 E: The repository 'http://cloud.r-project.org/bin/linux/debian bullseye-cran40/ InRelease' is not signed.  

how do I sign this as RUN apt-key doesn't seem to be working? Can I even set it up in this way for the debian version in 4.0-appservice? what am I missing?

many thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,679 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,456 Reputation points
    2022-11-11T09:40:34.177+00:00

    @Francisco Cavaco ,

    Thanks for reaching out to Q&A.
    Looks like apt-key is deprecated according to this article : https://dockerfile.run/apt-key

    Please refer to this SO issue for resolution : https://stackoverflow.com/questions/53371626/apt-key-command-works-on-shell-but-fails-on-dockerfile

    0 comments No comments