Skip to content

gadenbuie/docker-tidyverse-rjava

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-tidyverse-rjava

rocker/tidyverse with java and rJava.

Also includes RJDBC and odbc packages.

Using docker-compose

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.

Using Oracle Drivers

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")

Run the container without docker-compose

docker build -t tidyverse-rjava:latest .

docker run -d -rm -p 8787:8787 \
  -e PASSWORD="YourPassWordHere" \
  -v ./import:/home/rstudio/import \
  tidyverse-rjava:latest

About

rocker/rstudio with java and rJava

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%