Install - Java Viper Controller on a Containerized App for Static Analysis
Installation Steps
- Download the latest vFunction Sudoless Controller Installation TGZ
- Download a sample installation.yaml
- Download a sample startup.sh
- Set the Configurable Settings in the downloaded installation.yaml
- Modify the downloaded startup.sh under the “Restarting the controller” Section to be relevant for Viper
#!/usr/bin/env bash
set -x
echo "Restarting the controller"
bash /tmp/vfunction/opt/vfunction/controller-installation/restart-controller.sh -i default-java
while true
do
sleep 60
done
- Create a folder for vFunction artifacts in the Artifact Repository accessible by the Docker Build
- Add the vFunction Sudoless Controller Installation TGZ, the binaries for the Application, the installation.yaml and the startup.sh to the Artifact Repository
- Create a vFunction Viper-specific project in your CI/CD Pipeline
- Modify the Dockerfile that was downloaded
FROM almalinux:9
### Copy the Application's Binaries to the image
COPY /artifact_repository/app.war /tmp/vfunction/
### vFunction Copy workflow
COPY /artifact_repository/vfunction/vfunction-controller-sudo-less-installation*.tgz /tmp/vfunction-controller-sudo-less-installation.tgz
COPY /artifact_repository/vfunction/installation.yaml /tmp/
COPY /artifact_repository/vfunction/startup.sh /tmp/
### vFunction Run workflow
RUN cd /tmp && tar -xvf /tmp/vfunction-controller-sudo-less-installation.tgz && \
rm -f /tmp/vfunction-controller-sudo-less-installation.tgz && \
mv /tmp/installation.yaml /tmp/vfunction/etc/sysconfig/vfunction/installation/instances/default-java/ && \
mv /tmp/startup.sh /tmp/vfunction/ && \
bash /tmp/vfunction/opt/vfunction/controller-installation/install.sh -i default-java -n -v && \
chmod -R 777 /tmp/vfunction
### vFunction ENTRYPOINT workflow
ENTRYPOINT ["/bin/sh"]
CMD ["/tmp/vfunction/startup.sh"]
- Build and deploy the Viper Container
- Confirm that the Viper comes up as expected in the vFunction Server UI