Install - Java Static Agent on a Containerized App



Installation Wizard

To help with the installation process, vFunction offers an Installation Wizard. This Wizard provides additional information about the Prerequisites as well as the Required and Optional Settings for installing the vFunction Server and Agents. This Wizard also walks you through each step in the Installation process.


Installation Steps

  1. Download the latest vFunction Sudoless Controller Installation TGZ
  2. Download or copy-and-paste the Dockerfile below
  3. Modify the Dockerfile following the file’s Comments
FROM almalinux:9

### Copy the Application's Binaries to the image
RUN mkdir -p /tmp/vfunction/binaries/
# Modify /artifact_repository/vfunction/app.war and app.war to be relevant for your application
COPY /artifact_repository/vfunction/app.war /tmp/vfunction/binaries/app.war

### vFunction Environment Variables
# See description in https://kb.vfunction.com/installations/configurable-settings/mono-static-agent/java/linux
ARG VF_CONTROLLER_VIPERINST_CONTROLLER_NAME="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_CONTROLLER_HOST="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_CONTROLLER_ORG_ID="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_CONTROLLER_APP_ID="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_CONTROLLER_CLIENT_ID="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_CONTROLLER_CIENT_SECRET="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_CONTROLLER_INSTANCE_ID="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_CONTROLLER_TAGS="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_VIPER_JVM_MEMORY_PARAMS="CHANGE_ME"
ARG VF_CONTROLLER_VIPERINST_VIPER_ARCHIVES="/tmp/vfunction/binaries/app.war"

### Sample Values
### ARG VF_CONTROLLER_VIPERINST_CONTROLLER_NAME="Viper-prod"
### ARG VF_CONTROLLER_VIPERINST_CONTROLLER_HOST="http://vf_server_fqdn.organization.com"
### ARG VF_CONTROLLER_VIPERINST_CONTROLLER_ORG_ID="1111-11-11-1111"
### ARG VF_CONTROLLER_VIPERINST_CONTROLLER_APP_ID="1111-11-11-1111"
### ARG VF_CONTROLLER_VIPERINST_CONTROLLER_CLIENT_ID="1111-11-11-1111"
### ARG VF_CONTROLLER_VIPERINST_CONTROLLER_CIENT_SECRET="1111-11-11-1111"
### ARG VF_CONTROLLER_VIPERINST_CONTROLLER_INSTANCE_ID="viper"
### ARG VF_CONTROLLER_VIPERINST_CONTROLLER_TAGS="prod"
### ARG VF_CONTROLLER_VIPERINST_VIPER_JVM_MEMORY_PARAMS="-Xms300m -Xmx4g -Xss50m"
### ARG VF_CONTROLLER_VIPERINST_VIPER_ARCHIVES="/tmp/vfunction/binaries/app.war"

### vFunction Copy workflow
# Modify /artifact_repository to be relevant for your environment
COPY /artifact_repository/vfunction/vfunction-controller-sudo-less-installation*.tgz /tmp/vfunction-controller-sudo-less-installation.tgz

### vFunction Run workflow
RUN cd /tmp && tar -xvzf /tmp/vfunction-controller-sudo-less-installation.tgz && \
      rm -f /tmp/vfunction-controller-sudo-less-installation.tgz && \
      bash /tmp/vfunction/opt/vfunction/controller-installation/create-instance.sh -i viperinst -t java -v && \
      bash /tmp/vfunction/opt/vfunction/controller-installation/install.sh -i viperinst -n -s && \  
      chmod -R 777 /tmp/vfunction
      
### vFunction CMD workflow
CMD ["/bin/bash", "-c", "bash /tmp/vfunction/opt/vfunction/controller-installation/restart-controller.sh -i viperinst;sleep infinity"]
  1. Create a folder for vFunction artifacts in the Artifact Repository accessible by the Docker Build
  2. Add the vFunction Sudoless Controller Installation TGZ and the binaries for the Application to the Artifact Repository
  3. Create a vFunction Viper-specific project in your CI/CD Pipeline
  4. Build and deploy the Viper Container
  5. Confirm that the Viper comes up as expected in the vFunction Server UI