0

We are trying a setup that uses Ansible but not Docker. We are importing some RScripts that used to run in Docker. The Dockerfile that ran the RScripts began with:

FROM rocker/tidyverse:latest

This set up some paths and URLs for us, such as the one for the CRAN repos:

FROM ubuntu:focal

LABEL org.opencontainers.image.licenses="GPL-2.0-or-later" \
      org.opencontainers.image.source="https://github.com/rocker-org/rocker-versioned2" \
      org.opencontainers.image.vendor="Rocker Project" \
      org.opencontainers.image.authors="Carl Boettiger <cboettig@ropensci.org>"

ENV R_VERSION=4.2.1
ENV R_HOME=/usr/local/lib/R
ENV TZ=Etc/UTC

COPY scripts/install_R_source.sh /rocker_scripts/install_R_source.sh

RUN /rocker_scripts/install_R_source.sh

ENV CRAN=https://packagemanager.rstudio.com/cran/__linux__/focal/latest
ENV LANG=en_US.UTF-8

COPY scripts /rocker_scripts

RUN /rocker_scripts/setup_R.sh

CMD ["R"]

I'm curious if anyone knows of an Ansible playbook that would configure an EC2 instance like this?

charlottesville
  • 153
  • 1
  • 6
  • Your question is not very clear. You want to stop using docker and setup VMs to do the same job? And if yes why?! Everyone else is going the opposite way to save money and time :) – ttsakpc Aug 18 '22 at 10:02
  • It sounds like you understood the question, therefore the question was clear. From what I'm seeing, Python and PHP programmers are very into Docker, but other communities are having doubts about it, as there are other easier ways to get the same isolation, security, and scaleability. – charlottesville Aug 18 '22 at 18:02
  • OK then you can use ansible [copy](https://docs.ansible.com/ansible/2.9/modules/copy_module.html) module for the `COPY` commands in the Dockerfile and ansible [shell](https://docs.ansible.com/ansible/2.9/modules/shell_module.html) or [cmd](https://docs.ansible.com/ansible/2.9/plugins/shell/cmd.html) modules for the `RUN` commands. Regarding `FROM rocker/tidyverse:latest` you should practically setup the VM to have the same setup as this image before using it. You can view its Dockerfile and also run ansible to prepare the VM. – ttsakpc Aug 19 '22 at 07:15

0 Answers0