Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R Example Does Not Work as Docker Image #23

Open
BenGatewood opened this issue Oct 1, 2021 · 0 comments
Open

R Example Does Not Work as Docker Image #23

BenGatewood opened this issue Oct 1, 2021 · 0 comments

Comments

@BenGatewood
Copy link

I am trying to use the R example code provided in this repo which works fine until I try and run it inside a Docker container. I have tried multiple variations on the base Dockerfile listed here as well as the R-specific one in this article: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image

My Dockerfile presently looks like:

# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/node:2.0-appservice
FROM mcr.microsoft.com/azure-functions/node:3.0

ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true

RUN apt update
RUN apt install -y r-base
RUN R -e "install.packages('httpuv', repos='http://cran.rstudio.com/')"

COPY . /home/site/wwwroot

RUN cd /home/site/wwwroot

I've attached the full logs from attempting to run this but the only failure is:

fail: Worker.HttpWorkerProcess.bbbfc2f8-34a3-4a6b-89d9-8a537071af94[0]
      Failed to start Worker Channel. Process fileName: Rscript
System.ComponentModel.Win32Exception (2): No such file or directory
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Microsoft.Azure.WebJobs.Script.Workers.WorkerProcess.StartProcessAsync() in /src/azure-functions-host/src/WebJobs.Script/Workers/ProcessManagement/WorkerProcess.cs:line 65

As a test, I ran a shell in the base image: mcr.microsoft.com/azure-functions/node:3.0 and manually executed all the build steps in the Dockerfile. They all completed successfully and I could happily execute Rscript both with and without the full path to the executable

Any help greatly appreciated

logs.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant