Created
April 24, 2020 16:55
-
-
Save davidtedfordholt/06b5ffa6862f59e98dac0a6021a24584 to your computer and use it in GitHub Desktop.
Simple Dockerfile for R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Base image | |
FROM rocker/r-base | |
# Copy R scripts to container | |
COPY / ./ | |
# Execute when container is BUILT: | |
# sudo docker build -t example_container . | |
RUN Rscript setup.R | |
# Execute when container is RUN: | |
# sudo docker run --rm example_container | |
CMD Rscript run.R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("I built a container!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("I am building a container.") |
Or, for my very favorite @jtbaker:
echo -e "FROM rocker/r-base\n COPY / ./\n CMD Rscript run.R" >> Dockerfile && echo "print('I love you, Jason')" >> run.R && docker build -t ex . && docker run --rm ex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My first swag was just
but that seems a bit hard to extrapolate from. :)