Install IguanaX in Docker
With the pre-built IguanaX Linux Installation Script, it is fairly straight forward to install IguanaX as Docker container. Before starting, see Understanding Docker.
How to Create and Run IguanaX in Docker:
STEP 1: Download and and modify the sample dockerfile and install_iguana.sh (at end of this document)
A sample dockerfile and install_iguana.sh shell script can be used to create a docker image, install Iguana and run it inside the container. Modify the scripts as needed for your implementation.
In iguana_install.sh, please replace ADMIN_PASSWORD on line 68 with a secure admin password.
STEP 2: Build a Docker Image
Use the sample Dockerfile to build Docker Image called “iguana_image“
docker build -t iguana_image .
Note: If required, you can use the --platform flag to specify the OS and architecture you want to build.
STEP 3: Run Docker Image with port binding
Run above built docker image and binding docker port 7654 (IguanaX Dashboard port) with container port 8765.
docker run -d -p 8765:7654 --name iguana_container iguana_image
Note: If required, you can use the --platform flag to specify the OS and architecture you want to run.
STEP 4: Check Docker Logs
At this time, the docker should successfully installed and ran IguanaX application as runtime. You can check docker container logs for detail
docker logs iguana_container
Output:
Downloading Intel binary...
NEXT STEP to install Iguana is to copy, paste and run the following command:
sudo ./iguana --service install
Installing Iguana as a runtime with default password...
Log Dir: /home/iguanauser/.IguanaX/logt/
Updated login credentials to:
User: admin
Password: password
Note: Most Docker setups do not support systemd, so you can skip the install Iguana X as a service notification.
STEP 5: Access IguanaX in your browser
Open your local browser and access IguanaX with your configured admin password. http://localhost:8765/#dashboard
Other Considerations:
Automate IguanaX configuration by copying and reusing existing IguanaX Configurations
If you understand the structure of the IguanaX Working Directory, you can copy configuration files and settings as part of the IguanaX Docker install.
Move IguanaX Logs to a persisted volume
Since docker containers are perishable, IguanaX logs configured to be stored inside a docker container might be lost after the docker container stops.
A better architecture would be to set up a shared volume across different docker containers and move Iguana logs into this shared volume.
See Change the Log Directory and https://docs.docker.com/storage/volumes/ for details.
Automate license activation - this requires IguanaX v10.1.103
It is possible to automate the licensing of IguanaX by Calling IguanaX APIs and the Members Account Licensing APIs. There are a few simple steps:
-
Run Iguana and call the /license/get API to retrieve the IguanaID from your license details. Note: you'll need to first call /login with your set credentials to get the session cookie for authentication.
-
Use the Members Account Licensing APIs to:
-
Get an Authentication Token
-
Get a List of Entitlements (license types) and select the ID for the type you want to activate
-
Register your IguanaID to generate and retrieve a license code
-
Activate your Iguana by writing the new license code to the IguanaLicense file.
-
Below is modified sample iguana_install.sh script to call the IguanaX APIs and Members Account Licensing APIs to automate the licensing of your IguanaX instance. This is for IguanaX v1.10.103.
Skip to line 62 to review added logic to support license automation.
#!/bin/bash
# ---- IGUANAX LINUX SCRIPT *START* ----
function main {
clear;
if [[ "$(uname)" == "Darwin" ]]; then
echo "Sorry this is not a linux machine - it's Mac OS computer.";
echo "See: https://interfaceware.atlassian.net/wiki/spaces/IXB/pages/2634776607/";
echo "For step by step instructions on how to get a linux machine.";
return;
fi
if [[ -e iguana ]]; then
echo "The file 'iguana' already exists.";
echo "Either remove it (rm iguana), rename (mv iguana iguana_old) it or do this install";
echo "in another place.";
return;
fi;
# Check for wget or curl
if which wget > /dev/null 2>&1; then
WFETCH="wget -q -O ";
elif which curl > /dev/null 2>&1; then
WFETCH="curl -s -o ";
else
echo "Neither wget nor curl is available.";
echo "Please install them.";
return;
fi;
G=2.32;
# Determine architecture and download
if [[ $(uname -m) =~ ^(arm|aarch) ]]; then
printf "Downloading ARM binary...";
$WFETCH iguana https://downloads.interfaceware.com/downloads/10.1.103/linux/iguana-Arm;
G=2.32;
echo "";
else
printf "Downloading Intel binary...";
$WFETCH iguana https://downloads.interfaceware.com/downloads/10.1.103/linux/iguana;
G=2.26;
echo "";
fi;
chmod +x iguana;
Y=$(ldd --version | head -n 1 | awk '{print $NF}');
Y_int=${Y//./};
G_int=${G//./};
if [ "$Y_int" -lt "$G_int" ]; then
printf "Your current version of GLIBC is $Y, which is below the required ";
echo $G;
echo -e "PLEASE READ: https://interfaceware.atlassian.net/wiki/spaces/IXB/pages/2631434293/";
return;
fi;
}
main;
# ---- IGUANAX LINUX SCRIPT *END* ----
# Create .IguanaX folder and configurations subFolder
echo "Make or copy IguanaX configurations"
mkdir -p /home/iguanauser/.IguanaX/config
# Run Iguana in background
echo "Running Iguana..."
./iguana --set_admin_password ADMIN_PASSWORD
./iguana --run &
# Get process id
IguanaPID='echo "$!"'
echo "IguanaPID: $IguanaPID"
# Wait for Iguana to start to make license API calls
until curl -s "http://127.0.0.1:7654" > /dev/null; do
echo "Waiting for Iguana to start..."
sleep 5
done
echo "Iguana is now running!"
## ---- LICENSE AUTOMATION ---- ##
InterfacewareUser="MEMBERS_ACCOUNT_USERNAME" #CHANGE
InterfacewarePassword="MEMBERS_ACCOUNT_PASSWORD" #CHANGE
LicenseName="IguanaX Development" #addition to entitlementID call
# Get the IguanaID
IguanaID='/home/iguanauser/iguana --id'
echo "IguanaID: $IguanaID"
# Call Members Account API get license code:
# 1) Get Authentication Token
IguanaToken='curl -k -X POST "https://my.interfaceware.com/api?username=$InterfacewareUser&password=$InterfacewarePassword&method=session.login" 2>/dev/null | jq -r '.data.Token''
echo "IguanaToken: $IguanaToken"
# 2) Get EntitlementID of license type
EntitlementID='curl -k -X POST "https://my.interfaceware.com/api?method=license.listentitlements&product=IguanaX&token=$IguanaToken" 2>/dev/null | jq -r --arg name "$LicenseName" '.data[] | select(.name==$name) | .id''
echo "EntitlementID: $EntitlementID"
# 3) Register IguanaID to activate the license code
IguanaLicenseCode='curl -k -X POST "https://my.interfaceware.com/api?method=license.activate&product=IguanaX&token=$IguanaToken&description=IguanaLicense&entitlementid=$EntitlementID&instanceid=$IguanaID" 2>/dev/null | jq -r '.data.code''
echo "IguanaLicenseCode: $IguanaLicenseCode"
# Write the IguanaLinceseCode to the IguanaLicense file in the working directory
echo $IguanaLicenseCode > /home/iguanauser/.IguanaX/config/other/IguanaLicense;
# Kill Iguana and restart it in foreground
kill $IguanaPID
./iguana --run
Please reach out to support@interfaceware.com for assistant.
Dockerfile Sample
Note: Depending on your linux flavour, you may need to update the Docker Image and Installation commands.
# Use the Red Hat UBI (Universal Base Image)
FROM registry.access.redhat.com/ubi8/ubi
# Set the TERM environment variable
ENV TERM xterm
# Install necessary packages: wget, curl, git, coreutils, and sudo
RUN yum install -y wget curl git coreutils sudo --allowerasing && \
yum clean all && \
# Create a non-root user and group, and add to the wheel group for sudo access
useradd -ms /bin/bash iguanauser && \
usermod -aG wheel iguanauser && \
# Allow the wheel group to use sudo without a password
echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Copy the bash script into the container and set the correct permissions
COPY --chown=iguanauser:iguanauser install_iguana.sh /home/iguanauser/install_iguana.sh
RUN chmod +x /home/iguanauser/install_iguana.sh
# Switch to the non-root user and set the working directory
USER iguanauser
WORKDIR /home/iguanauser
# Execute the script
CMD ["bash", "./install_iguana.sh"]
install_iguana.sh Sample
Notes:
-
This sample downloads IguanaX v10.1.103. The Linux Installation Script from: https://downloads.interfaceware.com/iguanax/ can be updated from line 4 - 62.
-
You will need to update admin password on line 68 (replace ADMIN_PASSWORD)
#!/bin/bash
# ---- PASTE IGUANAX LINUX SCRIPT HERE *START* ----
function main {
clear;
if [[ "$(uname)" == "Darwin" ]]; then
echo "Sorry this is not a linux machine - it's Mac OS computer.";
echo "See: https://interfaceware.atlassian.net/wiki/spaces/IXB/pages/2634776607/";
echo "For step by step instructions on how to get a linux machine.";
return;
fi
if [[ -e iguana ]]; then
echo "The file 'iguana' already exists.";
echo "Either remove it (rm iguana), rename (mv iguana iguana_old) it or do this install";
echo "in another place.";
return;
fi;
# Check for wget or curl
if which wget > /dev/null 2>&1; then
WFETCH="wget -q -O ";
elif which curl > /dev/null 2>&1; then
WFETCH="curl -s -o ";
else
echo "Neither wget nor curl is available.";
echo "Please install them.";
return;
fi;
G=2.32;
# Determine architecture and download
if [[ $(uname -m) =~ ^(arm|aarch) ]]; then
printf "Downloading ARM binary...";
$WFETCH iguana https://downloads.interfaceware.com/downloads/10.1.103/linux/iguana-Arm;
G=2.32;
echo "";
else
printf "Downloading Intel binary...";
$WFETCH iguana https://downloads.interfaceware.com/downloads/10.1.103/linux/iguana;
G=2.26;
echo "";
fi;
chmod +x iguana;
Y=$(ldd --version | head -n 1 | awk '{print $NF}');
Y_int=${Y//./};
G_int=${G//./};
if [ "$Y_int" -lt "$G_int" ]; then
printf "Your current version of GLIBC is $Y, which is below the required ";
echo $G;
echo -e "PLEASE READ: https://interfaceware.atlassian.net/wiki/spaces/IXB/pages/2631434293/";
return;
fi;
}
main;
# ---- PASTE IGUANAX LINUX SCRIPT HERE *END* ----
# Create .IguanaX folder and configurations subFolder
echo "Make or copy IguanaX configurations"
mkdir -p ~/.IguanaX/config
# Install Iguana service
echo "Installing Iguana as a runtime with default password..."
./iguana --set_admin_password ADMIN_PASSWORD
./iguana --run