#Date Created: Jan 8, 2026 #Author Alex Gebben FROM rocker/r-ver:4.5.2 LABEL org.opencontainers.image.authors=agebben@uwyo.edu RUN apt-get update \ && apt-get install -y sudo #Create a sudo user not called root. This avoids permision issues when working with the files created in the docker and saved on a local unix system #RUN useradd -m -s /bin/bash rdocker RUN adduser --disabled-password --gecos '' rdocker \ && adduser rdocker sudo \ && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ && chmod 777 /usr/local/lib/R/site-library USER rdocker #Install all necessary packages for anaylysis, file manipulation, or for the required R packages to function. The first set of installs are packages related to geospatial work in R, this was copied from the rocker script found in /rocker-scripts/install_geospatial.sh. The second batch of installs are other packages I have installed for various workflows or as a dependency in otehr r-libraries RUN sudo apt-get update \ && sudo apt-get -y install gdal-bin lbzip2 libfftw3-dev libgdal-dev libgeos-dev libgsl0-dev libgl1-mesa-dev libglu1-mesa-dev libhdf4-alt-dev libhdf5-dev libjq-dev libpq-dev libproj-dev libprotobuf-dev libnetcdf-dev libsqlite3-dev libssl-dev libudunits2-dev netcdf-bin postgis protobuf-compiler sqlite3 tk-dev unixodbc-dev \ && sudo apt-get install -y libmariadb-dev imagemagick ghostscript libpoppler-cpp-dev vim wget curl git libcurl4-openssl-dev build-essential texlive-full default-jdk #Install the R packages used in the R data creation scripts run on on the docker container. RUN install2.r tidyverse fixest twang pdftools gt scales vars curl forecast uuid corrplot foreach cluster factoextra xtable Formula miscTools MASS kableExtra clisymbols fredr readxl lubridate tidycensus zipcodeR stargazer sandwich lmtest ggnewscale viridis ggthemes MatchIt optmatch aTSA tsDyn bruceR svars tidyquant zoo eia renv BiocManager miscTools logr zipcodeR usmap&& rm -rf /tmp/downloaded_packages #Packages used in DCchoice nuclear contigent valuation paper which require a special install method #Icens is required to be installed using BiocManager for DCchoice to be installed. #"interval" required Icens to be installed #BiocManager Version will need to be updated periodically. RUN R -e 'BiocManager::install(version = "3.22")'\ && R -e 'BiocManager::install("Icens")' \ && R -e "install.packages('DCchoice',dependencies=TRUE)" \ && install2.r interval \ && rm -rf /tmp/downloaded_packages WORKDIR /R-Code RUN sudo chmod -R 777 /R-Code #Add VIM R IDE to work in the Container, not required. #Packages used for a vim-R IDE. Can be removed if not used #Add vimrc which can be used with vimplug to run an R ide to perform R edits in the terminal. ADD VIM_R_IDE/.vimrc /home/rdocker/.vimrc