Skip to content
Snippets Groups Projects
Commit 14cfaffb authored by Informatica Cloud Lab's avatar Informatica Cloud Lab
Browse files

update final working dockerfile and README.md

parent 5463c77e
No related branches found
No related tags found
No related merge requests found
FROM debian:8.1
#first time you need to provide host name, name, and agent required creds
##example run command: docker run -d -h <hostname> --name <agent_name> <image_name:image_tag> <agent_username> <agent_password>
##ie., docker run -d -h jw2 --name jw2 test:3 jweber@000qio.org jetssuck
##ie., docker run -d -h jw1 --name jw1 test:3 jweber@informatica.com bp3luser
#subsequent runs can be done via docker start <container_id>
FROM ubuntu:16.04
# Read the README.md for more details on the image configuration
MAINTAINER Jaroslav Brazda <jaroslav.brazda@gmail.com>
# Upgrading system for wget and unzip tools
RUN apt-get update && \
apt-get -y install wget && \
apt-get -y install unzip
#you can override the target installation directory
ARG INSTALL_DIR=/informatica/agent
# Defines whre to download agent from (this might be different for your org)
ARG AGENT_URL=https://app2.informaticacloud.com/saas/download/linux64/installer/agent64_install.bin
# we need to run docker image under a different user than root because the Secure agent process engine can't be run under root account
COPY ./post-build-files /informatica/agent/
#setup
RUN mkdir "/informatica/agent/installer" && \
wget --no-check-certificate "https://app2.informaticacloud.com/saas/download/linux64/installer/agent64_install.bin" -O /informatica/agent/installer/agent64_install.bin && \
chmod +x /informatica/agent/entrypoint.sh && \
chmod +x /informatica/agent/register-agent.sh && \
chmod +x /informatica/agent/installer/agent64_install.bin
# install system tools
RUN apt-get update && \
apt-get -y install curl \
less \
locales \
locales-all \
sudo \
unzip
# Set the locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN useradd --create-home -ms /bin/bash -U agent
USER agent
#download and prepare Installer
RUN curl -o /tmp/agent64_install.bin $AGENT_URL && \
chmod +x /tmp/agent64_install.bin
#install
RUN chmod +x /informatica/agent/run_install.sh &&\
/informatica/agent/run_install.sh &&\
rm /informatica/agent/infaagent/main/tools/unzip/unzip &&\
ln -s /usr/bin/unzip /informatica/agent/infaagent/main/tools/unzip/unzip
#post install
RUN update-alternatives --install /usr/bin/java java /informatica/agent/infaagent/jre/bin/java 100
#unzip -o /informatica/work/agent_jars.zip -d /informatica/agent/infaagent
RUN ( /tmp/agent64_install.bin -i silent || true )
#cleanup
RUN rm /informatica/agent/installer/agent64_install.bin
RUN rm -rf /tmp/agent64_install.bin
WORKDIR /home/agent/infaagent/apps/agentcore
ENTRYPOINT ["/informatica/agent/entrypoint.sh", "/informatica/agent/infaagent"]
CMD [ "./agent_start.sh" ]
\ No newline at end of file
# Run Informatica Agent in Docker Container
## Description
This package contains example docker file and supporting scripts to run Informatica CLoud Secure Agent on DOcker Container
This package contains example docker file and supporting scripts to run Informatica CLoud Secure Agent on a Docker Container
## Use
1. Make sure you have docker installed
2. Clone this repo `git clone`
3. Update the `Dockerfile` if necessary (Location of the SA agent installer maight be different ofr your Informatica CLoud org)
4. run `run -d -h <hostname> --name <agent_name> <image_name:image_tag> <agent_username> <agent_password>`
example ""
1. Make sure you have docker installed gor to (https://docs.docker.com/engine/installation/)
2. Clone this repo `git clone `
3. Update the `Dockerfile` if necessary (Location of the SA agent installer maight be different ofr your Informatica CLoud org) You can override the default location by specifying `--build-arg <varname>=<value>` in nextr step
4. Run `docker build -t ic-secure-agent:1.0 .`
5. run `run -d -h <hostname> --name <agent_name> <image_name:image_tag>`
+ `docker run -d -h agent1 --name agent1 ic-secure-agent:1.0`
6. We need to configure the agent to connect it to your Informatica Cloud Org When you running agent for the first time, run followinng command in the host machine to connect to running agent
`docker exec -it ic-agent1 bash`
7. Then run following command to configure agent `./consoleAgentManager.sh configure '<sername>' '<password>'`
8. you can monitor agent running by calling `docker exec -it ic-agent1 less agentCore.log`
This docker file is based on Jeremy Weber's original used internally at Informatica
first time you need to provide host name, name, and agent required creds
example run command: `docker run -d -h <hostname> --name <agent_name> <image_name:image_tag> <agent_username> <agent_password>`
- `docker run -d -h agent1 --name agent1 test:3 jbrazda@informatica.org bp3luser`
- `docker run -d -h agent2 --name agent2 test:3 jweber@informatica.com bp3luser`
subsequent runs can be done via docker start <container_id>
#!/bin/bash
AGENT_HOME=$1
USERNAME=$2
PASSWORD=$3
_term() {
printf "%s\n" "Caught SIGTERM signal, stopping agent!"
$AGENT_HOME/main/agentcore/consoleAgentManager.sh shutdown
}
trap _term SIGINT SIGTERM
if [ "$USERNAME" == "--help" ]
then
echo 'docker run -d IMAGE[:TAG] <ics-username> <ics-password>'
else
nohup /informatica/agent/register-agent.sh $AGENT_HOME $USERNAME $PASSWORD > /informatica/agent/register.nohup &
$AGENT_HOME/agent_start.sh & wait $!
fi
\ No newline at end of file
#Choose Install Folder
#---------------------
USER_INSTALL_DIR=/informatica/agent/infaagent
\ No newline at end of file
#!/bin/bash
AGENT_HOME=$1
USERNAME=$2
PASSWORD=$3
COUNTER=1
echo 'Waiting for agent core to start'
sleep 10
CONFIGURED=`$AGENT_HOME/main/agentcore/consoleAgentManager.sh isConfigured`
while [[ -z $CONFIGURED && $COUNTER -lt 31 ]]
do
sleep 1
CONFIGURED=`$AGENT_HOME/main/agentcore/consoleAgentManager.sh isConfigured`
COUNTER=$[$COUNTER +1]
done
if [ -z $CONFIGURED ]
then
echo 'Agent core not started!'
elif [ "$CONFIGURED" != "true" ]
then
$AGENT_HOME/main/agentcore/consoleAgentManager.sh configure $USERNAME $PASSWORD
fi
\ No newline at end of file
export LAX_DEBUG=true
/informatica/agent/installer/agent64_install.bin -i silent -f /informatica/agent/installer.properties
echo Test Completed
echo $?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment