Updating gcc for Azure function in R with Docker

Mislav Sagovac 21 Reputation points


I am trying to deploy an Azure function in R with Docker. Certain packages require gcc >= 9 (C++17) but
I am unable to update it.


FROM mcr.microsoft.com/azure-functions/dotnet:3.0-appservice   
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \  
RUN apt-get install -y r-base r-base-dev  
RUN apt-get update -qq && apt-get install -y \   
   libssl-dev \   
   libcurl4-gnutls-dev \  
   libsodium-dev \  
RUN apt-get install -y gcc  
RUN gcc --version   
COPY  install_packages.R install_packages.R  
RUN Rscript /install_packages.R  
COPY . /home/site/wwwroot  

Do you have any suggestions on how to update gcc or install R with the correct version of gcc?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,049 questions
Microsoft Technologies based on the .NET software framework.
1,182 questions
{count} votes

Accepted answer
  1. Andriy Bilous 8,741 Reputation points

    Hello @Mislav Sagovac

    According to Microsoft Dockerhub repo you are using image mcr.microsoft.com/azure-functions/dotnet:3.0-appservice based on Debian 10 (Buster)
    Unfortunately there is no gcc-9 or higher version of this package for Debian 10 (Buster)

    I could suggest you to use newer Microsoft Dockerhub image mcr.microsoft.com/azure-functions/dotnet:4.0-appservice
    or try to build it from sources https://gist.github.com/s3rvac/76ac07f21d5635209accc11fa56bd3fb
    You will need to add few commands into your Dockerfile

    ADD "https://gist.githubusercontent.com/s3rvac/76ac07f21d5635209accc11fa56bd3fb/raw/70c33cf0121348aa33a2159449ac64afcfac01b0/gcc-10-debian-buster.sh" /script/gcc-10-debian-buster.sh  
    RUN chmod +x /script/gcc-10-debian-buster.sh  
    RUN /script/gcc-10-debian-buster.sh  

    If you think your question has been answered, click "Mark as Accept Answer" if just helped click "Vote as helpful". This can be beneficial to other community members reading this forum thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful