Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


To list the downloaded images from the Stonebranch repository, run the following command:

Panel
docker images -a stonebranch/universal-agent
REPOSITORYTAGIMAGE IDCREATEDSIZE
stonebranch/universal-agent6.6.0.1bc9dfbf7d36719 hours ago1.04GB
stonebranch/universal-agentlatestbc9dfbf7d36719 hours ago1.04GB

These images were created with the following

...

titleDockerfile

...


These images were created with the following

Expand
titleRHEL Dockerfile
# Set the base image to RedHat UBI
FROM redhat/ubi9:latest

# Install libcrypt-compat and procps (for pgrep and pkill)
RUN yum -y install libxcrypt-compat procps

# create label
LABEL name="universal-agent"
LABEL vendor="Stonebranch"
LABEL version="${local_ua_version}"
LABEL release="GA"
LABEL summary="Universal Agent installed in a UBI9 base Image"
LABEL description="Universal Agent can be used for Scheduling and File Transfer"
LABEL author="Stonebranch, Inc."

# create license directory and add product license
RUN mkdir /licenses
ADD /licenses/Terms_and_Conditions.pdf /licenses

# Install ua
ARG ua_version
ADD /ua_install/sb-${ua_version}-linux-3.10-x86_64.tar.Z /tmp
RUN zcat /tmp/sb-${ua_version}-linux-3.10-x86_64.tar.Z | tar xvf - && ./unvinst --network_provider oms --oms_servers 7878@localhost --oms_port 7878 --security inherit --ubroker_start no && rm unvinst *.rpm *.tar upimerge.sh upimerge.log usrmode.inc install.log /tmp/sb-${ua_version}-linux-3.10-x86_64.tar.Z
EXPOSE 7887 7878

# Set Permissions for Arbitrary ID Support
RUN chgrp -R 0 /etc/universal && chmod -R g=u /etc/universal && chgrp -R 0 /opt/universal && chmod -R g=u /opt/universal && chgrp -R 0 /var/opt/universal && chmod -R g=u /var/opt/universal && chmod g=u /etc/passwd

# Setup UBI Python
COPY ./ua_requirements /
RUN mkdir /opt/universal/python3.6 && mkdir /opt/universal/python3.6/bin && ln -s /bin/python3 /opt/universal/python3.6/bin/python3 && yum -y update && yum -y install python3-pip
RUN /bin/python3 -m pip install -r ua_requirements && rm ./ua_requirements

# Update path
ENV PATH "$PATH:/opt/universal/bin"

# Set Default userid
USER 10010

# Add entrypoint script
COPY ./ua_entrypoint /

# Set entrypoint
ENTRYPOINT [ "./ua_entrypoint" ]


Expand
titleDebian Dockerfile
# Set the base image to Debian
FROM debian:latest

# create label
LABEL name="universal-agent"
LABEL vendor="Stonebranch"
LABEL version="${local_ua_version}"
LABEL release="GA"
LABEL summary="Universal Agent installed in a
UBI
 Debian based Image"
LABEL description="Universal Agent can be used for Scheduling and File Transfer"
#
MAINTAINER "Colin Cocksedge <colin.cocksedge@stonebranch.com>
LABEL author="Stonebranch, Inc."

#

#
 create license directory and add product license
RUN mkdir /licenses
ADD /licenses/Terms_and_Conditions.pdf /licenses
# Install procps (for pgrep and pkill)
RUN apt-get update && apt-get install -y procps
# Install ua
ARG ua_version
ADD /ua_install
-files
/sb-${ua_version}-linux-3
.10
-x86_64-deb.tar.Z /tmp
RUN zcat /tmp/sb-${ua_version}-linux-3
.10
-x86_64-deb.tar.Z | tar xvf - && ./unvinst --network_provider oms --oms_servers 7878@localhost
--python yes
 --oms_port 7878 --security inherit --ubroker_start no && rm unvinst *.
rpm
deb *.tar upimerge.sh upimerge.log usrmode.inc install.log /tmp/sb-${ua_version}-linux-3
.10
-x86_64-deb.tar.Z
EXPOSE 7887 7878

#

#
 Set Permissions for Arbitrary ID Support
RUN chgrp -R 0 /etc/universal && chmod -R g=u /etc/universal && chgrp -R 0 /opt/universal && chmod -R g=u /opt/universal && chgrp -R 0 /var/opt/universal && chmod -R g=u /var/opt/universal && chmod g=u /etc/passwd

# Setup Python
COPY ./ua_requirements /
RUN mkdir
/var
 /opt/universal/python3.6 && mkdir /opt/universal/
uag/logs/
python3.6/bin && ln -s /
dev
usr/
null
bin/
var
python3 /opt/universal/
uag
python3.6/
logs/agent.log &&
#
ENV PATH
bin/python3 && apt-get install -y python3-pip
RUN python3 -m pip install -r ua_requirements && rm ./ua_requirements

# Update path
ENV PATH "$PATH:/opt/universal/bin"

# Set Default userid
USER 10010

# Add entrypoint script
COPY ./ua_entrypoint /

#
Entry Point
 Set entrypoint
ENTRYPOINT [ "./ua_entrypoint" ]



Expand
titleEntrypoint Script
#!/bin/bash 

 


echo "Entrypoint Version 1.
7
8"
 
 

# Handle Docker Stop, Terminate any active Tasks, and Terminate Ubroker Cleanly
shutdown() {
    kill -TERM
 
pkill -P $(pgrep uagsrv)
kill -TERM "$ubroker"
   
wait "$ubroker" 
   
exit 0 
}
# Recognize Termination
trap 'shutdown' SIGINT SIGTERM
# Support Arbitrary User IDs
if ! whoami &> /dev/null; then
 
if [ -w /etc/passwd ]; then 
   
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd 
 
fi 
fi

 


# Set UBroker Message Level
if [ ! -z "$UBRMSGLEVEL" ]; then
 
sed -ri "s/^message_level.*/message_level $UBRMSGLEVEL/g" /etc/universal/ubroker.conf 
fi

 


# Set UAG Server Message Level
if [ ! -z "$UAGMSGLEVEL" ]; then
 
sed -ri "s/^message_level.*/message_level $UAGMSGLEVEL/g" /etc/universal/uags.conf 
fi

 


# Set UDM Server Message Level
if [ ! -z "$UDMMSGLEVEL" ]; then
 
sed -ri "s/^message_level.*/message_level $UDMMSGLEVEL/g" /etc/universal/udms.conf 
fi

 


# Set UCMD Server Message Level
if [ ! -z "$UCMMSGLEVEL" ]; then
 
sed -ri "s/^message_level.*/message_level $UCMMSGLEVEL/g" /etc/universal/ucmds.conf 
fi
 
 

# Set UAG Server Log Level
if [ ! -z "$UAGLOGLEVEL" ]; then
 
sed -ri "s/^loglvl.*/loglvl $UAGLOGLEVEL/g" /etc/universal/uags.conf 
fi

 


# Start the Agent
/opt/universal/ubroker/bin/ubroker -dest stderr &
ubroker=$!
wait "$ubroker"


Docker Environment Variables

...

The Universal Agent image configures the Universal Broker service to start in console mode, which writes all log data (unv.log and agent.log) to stdout. To view the log of a specific container, run the following command:

Panel
docker logs container-name


Anchor
Running Universal Agent Docker Container Examples
Running Universal Agent Docker Container Examples
Running Universal Agent Docker Container Examples

To run a Universal Agent 6.6.0.1 latest version container that connects to Universal Controller (via an OMS server) with SSL/TLS enabled and registers with an Agent ID of UA001, run the following command:

Panel
docker run --detach --env UAGNETNAME=UA001 --env UAGOMSSERVERS=7878@uchost --name ua-test stonebranch/universal-agent:
6.6.0.1
latest