-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new (experimental) docker build script for Apple Silicon chips.…
… Changed container launch script to have alternate commands for Mac and Git Bash (not tested yet, how it works on WSL bash). Readme updated
- Loading branch information
Showing
4 changed files
with
184 additions
and
15 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Latest image from rocker: https://rocker-project.org/ | ||
FROM --platform=linux/arm64 rocker/rstudio:latest | ||
|
||
RUN apt-get clean all && \ | ||
apt-get update && \ | ||
apt-get upgrade -y | ||
|
||
# Install R packages | ||
RUN install-silicon.sh | ||
|
||
COPY --chown=rstudio:rstudio rstudio-prefs.json \ | ||
/home/rstudio/.config/rstudio | ||
|
||
COPY --chown=rstudio:rstudio .Rprofile /home/rstudio/ | ||
|
||
EXPOSE 8787 | ||
|
||
WORKDIR /home/rstudio | ||
|
||
[/init] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Install script for additional packages needed for Apple silicon chips that | ||
# have to rely on rocker/rstudio image built with ARM64 | ||
# Adapted from scripts provided by rocker, e.g. | ||
# https://github.com/rocker-org/rocker-versioned2/blob/master/scripts/\ | ||
# install_tidyverse.sh | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
## build ARGs | ||
NCPUS=${NCPUS:--1} | ||
|
||
# a function to install apt packages only if they are not installed | ||
function apt_install() { | ||
if ! dpkg -s "$@" >/dev/null 2>&1; then | ||
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then | ||
apt-get update | ||
fi | ||
apt-get install -y --no-install-recommends "$@" | ||
fi | ||
} | ||
|
||
apt_install \ | ||
libxml2-dev \ | ||
libcairo2-dev \ | ||
libgit2-dev \ | ||
default-libmysqlclient-dev \ | ||
libpq-dev \ | ||
libsasl2-dev \ | ||
libsqlite3-dev \ | ||
libssh2-1-dev \ | ||
libxtst6 \ | ||
libcurl4-openssl-dev \ | ||
libharfbuzz-dev \ | ||
libfribidi-dev \ | ||
libfreetype6-dev \ | ||
libpng-dev \ | ||
libtiff5-dev \ | ||
libjpeg-dev \ | ||
unixodbc-dev \ | ||
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 | ||
|
||
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \ | ||
tidyverse \ | ||
devtools \ | ||
rmarkdown \ | ||
RColorBrewer \ | ||
RandomFields \ | ||
RNetCDF \ | ||
classInt \ | ||
deldir \ | ||
gstat \ | ||
hdf5r \ | ||
mapdata \ | ||
maptools \ | ||
mapview \ | ||
ncdf4 \ | ||
proj4 \ | ||
raster \ | ||
rgdal \ | ||
rgeos \ | ||
rlas \ | ||
sf \ | ||
sp \ | ||
spacetime \ | ||
spatstat \ | ||
spatialreg \ | ||
spdep \ | ||
stars \ | ||
terra \ | ||
tidync \ | ||
tmap \ | ||
geoR \ | ||
geosphere \ | ||
rmapshaper \ | ||
patchwork \ | ||
kableExtra \ | ||
prettydoc \ | ||
cowplot \ | ||
here \ | ||
rmdformats | ||
|
||
|
||
# Clean up | ||
rm -rf /var/lib/apt/lists/* | ||
rm -rf /tmp/downloaded_packages | ||
|
||
## Strip binary installed lybraries from RSPM | ||
## https://github.com/rocker-org/rocker-versioned2/issues/340 | ||
strip /usr/local/lib/R/site-library/*/libs/*.so |
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