4

I am having an issue with docker-compose..I am a newbiew with docker.

I can build my R server with success. Here is the Dockerfile:

FROM ubuntu:16.04

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
RUN echo "deb http://cran.r-project.org/bin/linux/ubuntu trusty/" |  tee -a /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y curl libcurl4-openssl-dev
RUN apt-get install -y apt-utils

RUN apt-get install -y r-base
RUN apt-get install -y r-base-dev
RUN apt-get install -y libssl-dev

ENTRYPOINT ["/usr/bin/R"]

Here is my docker compose file which has a python worker server that needs to call R:

version: '3'
services:
  worker:
    build: .
    image: mtm/mtm-worker-server
  r-server:
    image: "mtm/mtm-rserver"

Here is the error:

docker-compose up
Recreating compose-mtm-worker_r-server_1 ... done
Starting compose-mtm-worker_worker_1     ... done
Attaching to compose-mtm-worker_r-server_1, compose-mtm-worker_worker_1
r-server_1  | Fatal error: you must specify '--save', '--no-save' or '--vanilla'
compose-mtm-worker_r-server_1 exited with code 2

I have no idea why I am getting this error:

Fatal error: you must specify '--save', '--no-save' or '--vanilla'

PS

I added this to my dockerfile and I got the below:

ENTRYPOINT ["sh", "-c"]

Why did that make a difference?

Recreating compose-mtm-worker_r-server_1 ... done
Starting compose-mtm-worker_worker_1     ... done
Attaching to compose-mtm-worker_worker_1, compose-mtm-worker_r-server_1
r-server_1  | sh: 0: -c requires an argument
compose-mtm-worker_r-server_1 exited with code 2
Tampa
  • 75,446
  • 119
  • 278
  • 425

1 Answers1

4

Fatal error: you must specify '--save', '--no-save' or '--vanilla'

is the error you get when R detects it is being run non-interactively. If the message is valid, you can select one of the options.

Sometimes this is inappropriately triggered. In those cases you just use the --ess option.

There's a SO thread that discusses ENTRYPOINT here. Looks like it helps configure the container and I guess you're telling it to use the sh shell, which perhaps R recognizes over whatever the default (Docker?) shell it was interacting with. I'm kind of guessing on the last part (about ENTRYPOINT), I don't know Docker well either, but it does make sense, given then error message you encountered.

Hack-R
  • 22,422
  • 14
  • 75
  • 131