You can install a custom Certificate Authority (CA) to the R runtime of the Exploratory Server by creating a customized Docker image based on the default R environment Docker image.
Run the following command to start a Docker container based on the default r-exploratory Docker image. In this example, we use the Docker image from Exploratory Server version 6.12.3.6. Please replace the version number in the command with the one you are using.
docker run -it r-exploratory:6.12.3.6 /bin/bash
With the shell you opened, install a custom CA that you want to use.
First, you can copy the CA certificate file to /usr/share/ca-certificates
directory. You can use any file name as long as you use the .crt
suffix.
Once you copy your file, run the following command to enable the CA certificate.
dpkg-reconfigure ca-certificates
Do not close the shell and proceed to the next step.
Open another shell on the host Linux machine, and run the following command to find the ID of the Docker container we just ran and made the modifications on.
docker ps
The above command should give the table that looks like the following as the output.
CONTAINER ID IMAGE COMMAND PORTS
aad6f8d956a9 r-exploratory:6.12.3.6 "/bin/bash" 6311/tcp
If you see multiple lines in the output, look for a line with r-exploratory
and /bin/bash
.
Find the Container ID for the Docker container from the table. In this case, it's aad6f8d956a9.
With the ID, you can now create a Docker image with the modifications. Here, let's give the new image the customized version number 6.12.3.6.1.
docker commit -c 'CMD ["R", "-e", "Rserve::run.Rserve(remote=TRUE)"]' -c 'EXPOSE 6311' aad6f8d956a9 r-exploratory:6.12.3.6.1
Start a Docker container with the new Docker image you just created.
docker run -it r-exploratory:6.12.3.6.1 /bin/bash
It opens a new shell. Make sure your CA certificate file exists.
ls /usr/share/ca-certificates
Locate the line in the docker-compose.yml
file that specified the Docker image version for the r-exploratory Docker container that looks like the following.
...
rserve:
image: r-exploratory:6.12.3.6
...
Modify the version to the one you just created.
...
rserve:
image: r-exploratory:6.12.3.6.1
...
Now, you can restart the Exploratory Server to make the change effective in the R environment of the Exploratory Server.