rocker/tidyverse with java and rJava.
Also includes RJDBC
and odbc
packages.
Clone this repo and then run docker-compose
to start up the container.
# Clone the repo
git clone https://github.com/gadenbuie/docker-tidyverse-rjava.git
cd docker-tidyverse-rjava
# Start the container
docker-compose up -d --build
The import/
folder is automatically mounted in the container at /home/rstudio/import
and the USER
and PASSWORD
fields are set inside the docker-compose.yml
file; view the file to see these passwords or edit the file to change them.
Oracle InstaClient drivers are not included in this image because Oracle requires users to log in before downloading them.
To obtain the drivers, visit https://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html, click Download and choose the Basic or Basic Light Instant Client Package for Linux x86-64. Copy the downloaded zip file into the import/
folder of this repo and extract.
If you use docker-compose
to start up the docker image, you can then reference the odbc8.jar
file in ~/import/instantclient_12_2/odbc8.jar
for use with RJDBC.
library(RJDBC)
drv <- JDBC("oracle.jdbc.OracleDriver", classPath="~/import/instantclient_12_2/ojdbc8.jar")
con <- dbConnect(drv,"jdbc:oracle:thin:@server:1521:database",
rstudioapi::askForSecret("Username"),
rstudioapi::askForPassword("Database Password"))
dbGetQuery(con,"select count(*) from shema.table")
docker build -t tidyverse-rjava:latest .
docker run -d -rm -p 8787:8787 \
-e PASSWORD="YourPassWordHere" \
-v ./import:/home/rstudio/import \
tidyverse-rjava:latest