Docker Containers

Downloading a Universal Agent Docker Image

Universal Agent Images are available based on the following RedHat Linux and Debian base images.

RedHat  = registry.access.redhat.com/ubi8/ubi:latest

Debian = debian:latest

To download an image from the Docker Hub, run the following command:

docker pull stonebranch/universal-agent:latest

Available Tags

Description

Tags

UA 7.2.0.0 Redhat

latest, 7.2.0.0

UA 7.2.0.0 Debian

debian-latest, debian-7.2.0.0

UA 7.1.0.1 Redhat

7.1.0.1

UA 7.0.0.0 Redhat

7.0.0.0

UA 6.9.0.1 Redhat

6.9.0.1


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

docker images -a stonebranch/universal-agent

REPOSITORYTAGIMAGE IDCREATEDSIZE
stonebranch/universal-agent

debian-latest

ae21b1fa64cc

2 hours ag

1.39GB

stonebranch/universal-agent

latest

157f01823f68

13 days ago

1.54GB


These images were created with the following

 Redhat Dockerfile

# Set the base image to RedHat UBI
FROM registry.access.redhat.com/ubi8/ubi:latest
# create label
LABEL name="universal-agent"
LABEL vendor="Stonebranch"
LABEL version="${ua_version}"
LABEL release="GA"
LABEL summary="Universal Agent installed in a UBI based Image"
LABEL description="Universal Agent can be used for Scheduling and File Transfer"
LABEL author="Colin Cocksedge <colin.cocksedge@stonebranch.com>"
#
# create license directory and add product license
RUN mkdir /licenses
ADD /licenses/Terms_and_Conditions.pdf /licenses
# Install ua
ARG ua_version
ADD /install-files/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 --python yes --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
# Temp Change
RUN /opt/universal/python/bin/pip3.7 install cryptography --upgrade
# Update path
ENV PATH "$PATH:/opt/universal/bin"
# Set Default userid
USER 10010
# Add entrypoint script
COPY ./ua_entrypoint /
# Set entrypoint
ENTRYPOINT [ "./ua_entrypoint" ]

 Debian Dockerfile

# Set the base image to Debian
FROM debian:latest
# create label
LABEL name="universal-agent"
LABEL vendor="Stonebranch"
LABEL version="${ua_version}"
LABEL release="GA"
LABEL summary="Universal Agent installed in a Debian based Image"
LABEL description="Universal Agent can be used for Scheduling and File Transfer"
LABEL author="Colin Cocksedge <colin.cocksedge@stonebranch.com>"
#
# create license directory and add product license
RUN mkdir /licenses
ADD /licenses/Terms_and_Conditions.pdf /licenses
# Install ua
ARG ua_version
ADD /install-files/sb-${ua_version}-linux-3-x86_64-deb.tar.Z /tmp
RUN zcat /tmp/sb-${ua_version}-linux-3-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 *.deb *.tar upimerge.sh upimerge.log usrmode.inc install.log /tmp/sb-${ua_version}-linux-3-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
# Temp Change
RUN /opt/universal/python/bin/pip3.7 install cryptography --upgrade

# Update path
ENV PATH "$PATH:/opt/universal/bin"
# Set Default userid
USER 10010
# Add entrypoint script
COPY ./ua_entrypoint /
# Set entrypoint
ENTRYPOINT [ "./ua_entrypoint" ]



 Entrypoint Script

#!/bin/bash

 

echo "Entrypoint Version 1.7"

 

# Handle Docker Stop and Terminate Ubroker Cleanly

shutdown() {

    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


When you create a Universal Agent container, you can configure the Universal Agent by specifying the following environment variables:

Environment VariableDescriptionExample
OMSAUTOSTART

Specifies whether the Universal Broker starts an OMS server.

Default = no

OMSAUTOSTART=yes
UAGAGENTCLUSTERS

List of Universal Controller Agent Clusters to join automatically.

Default = 'Opswise - Default Linux/Unix Cluster, Opswise - Default Windows Cluster'

UAGAGENTCLUSTERS='Agent Cluster 1,Agent Cluster 2'
UAGAUTOSTART

Specifies whether the Universal Broker starts a UAG server.

Default = yes

UAGAUTOSTART=no
UAGENABLESSL

Specifies whether the SSL/TLS protocol is used for network communication between UAG and OMS.

Default = no

UAGENABLESSL=yes

 UAGNETNAME

Sets the Agent ID to be used when the Universal Agent registers / connects to a Universal Controller Instance.

Default = OPSAUTOCONF

UAGNETNAME=UADKR001
UAGOMSSERVERS

Specifies one or more OMS server addresses.

Default = 7878@localhost

UAGOMSSERVERS=7878\@omsserver1,7878\@omsserver2
UAGTRANSIENT

Specifies whether the Agent is Transient and will be deleted or decommissioned when the Agent shuts down or goes offline.

Transient Agents are suspended from any Agent Clusters that they may belong to.

Note

If the Agent is referenced in any task definitions, the dynamic delete will fail. It should be understood that Transient Agents should never be specified directly in any task definition. They are designed to accept work via an Agent Cluster, so when configuring a Universal Agent to operate in a containerized environment, you should ensure that the Agent registers with one or more Agent Clusters via the agent_cluster uags.conf configuration option.

Valid values are:

  • yes
    Agent is registered as a transient Agent.
  • no
    Agent is registered as a regular, persistent Agent.

Default = no.

UAGTRANSIENT=yes

UEMAUTOSTART

Specifies whether the Universal Broker starts a UEM server.

Default = yes

UEMAUTOSTART=no

UBRMSGLEVEL

Specify the Universal Broker message level.

Default = INFO

UBRMSGLEVEL=TRACE

UAGMSGLEVEL

Specify the UAG Server message level.

Default = INFO

UAGMSGLEVEL=TRACE

UDMMSGLEVEL

Specify the UDM Server message level.

Default = INFO

UDMMSGLEVEL=TRACE

UCMMSGLEVEL

Specify the UCMD Server message level.

Default = INFO

UCMMSGLEVEL=TRACE

UAGLOGLEVEL

Specify the UAG Server Log Level.

Default = I

UAGLOGLEVEL=T

Docker Container Ports

The following ports may need to be mapped when running containers from the Universal Agent image.

PortDescription
7887Universal Broker listening port
7878OMS Server listening port

Universal Agent Logs

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:

docker logs container-name


Running Universal Agent Docker Container Examples

To run a Universal Agent 6.6.0.1 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:

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