If your node manager does not have external access to the internet, then you can create a Docker image on an internet-enabled computer, and then transfer it to your node manager.
About this task
Perform the first three steps of this task from the command line on a computer with internet access. Perform the rest of the task from the command line on the computer where your node manager is installed.
Before you begin
- You must have a computer with access to internet, and that has Docker installed on it.
- You must have a Linux computer where the node manager is installed. (Your node manager and Spotfire Server can be on different computers).
- You must have Docker installed on the computer running the node manager. If you install and start Spotfire Service for Python before you install Docker, then exceptions are written to the log.
Custom docker images for the Python service must contain the following.
Procedure
-
On a computer with internet access, create the
Dockerfile.
Important: Remember that for any script you write, the line endings must be appropriate for the operating system where Spotfire Service for Python runs. Many text editors can perform end-of-line (EOL) conversion.
############################################
# A sample Dockerfile for a startup script. #
#############################################
FROM AlmaLinux:8.5
# install openjdk
RUN yum update -y && yum install -y java-17-openjdk && yum clean all
# set JAVA_HOME variable
ENV JAVA_HOME=/usr/lib/jvm/jre
-
Build the image specifying the name and tag.
Use the command
docker build -t
<name:version>
, as follows.
docker build -t pysrv:258 .
-
Save the image to a
.tar file.
Use the command
docker save -o
<name-version>.tar
<name:version>
, as follows.
docker save -o pysrv-258.tar pysrv:258
-
If you have already installed Spotfire Service for Python from the Spotfire Server
Nodes & Services page, and if it is running, then stop the service.
-
Transfer the
.tar file to the target computer (where the node manager is running).
-
Load the
.tar file into the node manager.
Use the command
docker load -i
<name-version>.tar
, as follows.
$ sudo docker load -i pysrv-258.tar
f2419d350464: Loading layer [==================================================>] 329.5MB/329.5MB
Loaded image: terrsrv:258
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
pysrv 258 9941b68e7f65 17 hours ago 517MB
-
On the computer running Spotfire Server, export the
custom.properties as described in steps 1-3 of
Configuring Spotfire Service for Python.
-
Edit the settings in the file
custom.properties, specifying the name and tag of your custom image.
use.engine.containers: TRUE
docker.image.name: <name:version>
-
On the computer running Spotfire Server, import the
custom.properties as described in
Configuring Spotfire Service for Python.
-
From the Spotfire Server
Nodes & Services page, install the service, specifying the configuration to use, and then start the service.