FROM public.ecr.aws/amazonlinux/amazonlinux:2 # Set versions and platforms ARG R_VERSION=4.1.3 ARG PYTHON_VERSION=3.9.5 ARG DRIVERS_VERSION=2021.10.0-1 # Install RStudio Workbench session components -------------------------------# RUN yum update -y && \ yum install -y \ libcurl-devel \ libuser-devel \ openssl-devel \ postgresql-libs \ rrdtool && \ yum clean all ARG RSW_VERSION=2022.02.2-485.pro2 ARG RSW_NAME=rstudio-workbench-rhel ARG RSW_DOWNLOAD_URL=https://s3.amazonaws.com/rstudio-ide-build/server/centos7/x86_64 RUN RSW_VERSION_URL=`echo -n "${RSW_VERSION}" | sed 's/+/-/g'` \ && curl -o rstudio-workbench.rpm ${RSW_DOWNLOAD_URL}/${RSW_NAME}-${RSW_VERSION_URL}-x86_64.rpm \ && yum install -y rstudio-workbench.rpm \ && rm rstudio-workbench.rpm \ && yum clean all \ && rm -rf /var/lib/rstudio-server/r-versions EXPOSE 8788/tcp # Install additional system packages ------------------------------------------# RUN yum update -y && \ yum install -y \ wget \ git \ libxml2-devel \ subversion \ which \ tar \ jq && \ yum clean all # Install R -------------------------------------------------------------------# RUN yum update -y && \ amazon-linux-extras install epel -y && \ yum install -y epel-release && \ yum clean all # Install main R version RUN curl -O https://cdn.rstudio.com/r/centos-7/pkgs/R-${R_VERSION}-1-1.x86_64.rpm && \ yum install -y R-${R_VERSION}-1-1.x86_64.rpm && \ yum clean all && \ rm -rf R-${R_VERSION}-1-1.x86_64.rpm RUN ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R && \ ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript # Install additional R versions # Looking at https://docs.rstudio.com/resources/install-r/ for available versions # # Installing: # 4.0.5, 3.6.3, 3.5.3 RUN curl -O https://cdn.rstudio.com/r/centos-7/pkgs/R-4.0.5-1-1.x86_64.rpm && \ yum install -y R-4.0.5-1-1.x86_64.rpm && \ yum clean all && \ rm -rf R-4.0.5-1-1.x86_64.rpm RUN curl -O https://cdn.rstudio.com/r/centos-7/pkgs/R-3.6.3-1-1.x86_64.rpm && \ yum install -y R-3.6.3-1-1.x86_64.rpm && \ yum clean all && \ rm -rf R-3.6.3-1-1.x86_64.rpm RUN curl -O https://cdn.rstudio.com/r/centos-7/pkgs/R-3.5.3-1-1.x86_64.rpm && \ yum install -y R-3.5.3-1-1.x86_64.rpm && \ yum clean all && \ rm -rf R-3.5.3-1-1.x86_64.rpm # Install Python --------------------------------------------------------------# RUN yum update -y && \ yum install -y bzip2 && \ yum clean all RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh && \ bash Miniconda3-4.7.12.1-Linux-x86_64.sh -bp /opt/python/${PYTHON_VERSION} && \ /opt/python/${PYTHON_VERSION}/bin/conda install -y python==${PYTHON_VERSION} && \ rm -rf Miniconda3-*-Linux-x86_64.sh ENV PATH="/opt/python/${PYTHON_VERSION}/bin:${PATH}" # Install RStudio Professional Drivers ----------------------------------------# RUN yum update -y && \ yum install -y unixODBC unixODBC-devel && \ yum clean all RUN curl -O https://drivers.rstudio.org/7C152C12/installer/rstudio-drivers-${DRIVERS_VERSION}.el7.x86_64.rpm && \ yum install -y rstudio-drivers-${DRIVERS_VERSION}.el7.x86_64.rpm && \ yum clean all && \ rm -f rstudio-drivers-${DRIVERS_VERSION}.el7.x86_64.rpm && \ cp /opt/rstudio-drivers/odbcinst.ini.sample /etc/odbcinst.ini RUN /opt/R/${R_VERSION}/bin/R -e 'install.packages("odbc", repos="https://packagemanager.rstudio.com/cran/__linux__/centos7/latest")' # RStudio-specific customizations --------------------------------------------------------# RUN /opt/R/${R_VERSION}/bin/R -e 'install.packages(c("reticulate", "readr", "curl", "ggplot2", "dplyr", "stringr", "fable", "tsibble", "dplyr", "feasts", "remotes", "urca", "sodium", "plumber", "jsonlite"), repos="https://packagemanager.rstudio.com/cran/__linux__/centos7/latest")' RUN /opt/python/${PYTHON_VERSION}/bin/pip install --upgrade \ 'boto3>1.0<2.0' \ 'awscli>1.0<2.0' \ 'sagemaker[local]<3' \ 'sagemaker-studio-image-build' \ 'numpy' # Locale configuration --------------------------------------------------------# RUN yum update -y && \ yum install -y glibc-locale-source glibc-langpack-en && \ yum clean all RUN localedef -i en_US -f UTF-8 en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 # Studio-specific customizations --------------------------------------------------------# RUN yum update -y && \ yum install -y sudo \ vim \ openjdk-11-jdk \ libpng-dev \ && yum clean all # Set default env values # RSessionGateway consumes these environment variables to do dynamic configuration in rsession.conf. ENV RSTUDIO_CONNECT_URL "" ENV RSTUDIO_PACKAGE_MANAGER_URL ""