Below we include two examples for working with images in Docker along with a demonstration video showing the package in action.
The RCOBOLDI Rocker/RStudio image is available on DockerHub. This image is built using dependencies which have been deployed in the Drat repository.
The RCOBOLDI Rocker/Verse image is a complete build using source code cloned from the GitHub repository.
The following is a fully working example based on the Rocker/RStudio image.
docker pull thospfuller/rcoboldi-rockstar-rstudio:[latest or 1.0.3 or some other tag]
then
docker image ls
should show something like this:
REPOSITORY TAG IMAGE ID CREATED SIZE thospfuller/rcoboldi-rockstar-rstudio 1.0.3 3f8c1c269940 37 minutes ago 2.42GB
then
docker run -d -p 8787:8787 -e PASSWORD=password --name rstudio -i -t 3f8c1c269940
The next step is to test this in R so point your browser to http://localhost:8787 and use "rstudio" and "password" to login and then execute the following:
library(RCOBOLDI)
RCOBOLDI::Initialize()
result <- RCOBOLDI::ReadCopyBookAsDataFrame("/home/rstudio/rcoboldi/java/rcoboldi-core/src/test/resources/example1/DTAR020.cbl", "/home/rstudio/rcoboldi/java/rcoboldi-core/src/test/resources/example1/DTAR020.bin", "Fixed Length Binary", "cp037")
head(result)
docker build -t rcoboldi/rocker-rstudio:1.0.1 https://raw.githubusercontent.com/thospfuller/rcoboldi/master/docker/rocker/rstudio/Dockerfile
[some image id]
docker run -d -p 8787:8787 -e PASSWORD=password --name rstudio -i -t [some image id]
[some container id]
Step 3.) Browse to http://localhost:8787 and enter the username & password combination rstudio & password.
The next three steps appear in the video.
Steps 4-7.) From the R CLI execute:
### Step 4.)
library(RCOBOLDI)
### Step 5.)
RCOBOLDI::Initialize()
### Step 6.)
result <- RCOBOLDI::ReadCopyBookAsDataFrame("DTAR020.cbl", "DTAR020.bin", "Fixed Length Binary", "cp037")
### Step 7.)
head(result)
If you're looking to load COBOL data files into the R Project for Statistical Computing then you came to the right place.
The Dockerfile in this example is based on Rocker / RStudio and will be running locally on port 8787.
Below is a video which demonstrates the R COBOL Data Integration package running in Docker.