Reputation: 9169
I have a shell script that runs a Python program to pre-process some data and then runs an R program that does some long running task on it. I'm learning to use Docker and I've been running
FROM r-base:latest
FROM python
COPY . /usr/local/src/scripts
WORKDIR /usr/local/src/scripts
CMD ["./myscript.sh"]
To my understanding it does the following:
/usr/local/src/scripts
/usr/local/src/scripts
./myscript.sh
Inside myscript.sh
I use the R CMD ...
syntax for running my R script. However, when this docker image is run I get the following error:
./myscript.sh: line 8: R: command not found
This suggests that the script, when run inside the container, is not recognizing the R program. I can confirm that ./myscript.sh
works locally but I cannot expose any proprietary code.
Upvotes: 1
Views: 218
Reputation: 1059
The FROM command sets the base image that your Dockerfile builds on. You should only have one of these. After that, if you need additional tools that aren't in the base image, run commands that use platform-dependent package managers, such as
RUN apt-get update && apt-get install -y \
package-foo \
package-bar
This would be for a Debian-based image, such as Ubuntu.
Upvotes: 1