Apama 10.15.0 | Deploying and Managing Apama Applications | Deploying Apama Applications with Docker | Quick start to using an Apama image
 
Quick start to using an Apama image
The Apama image that we are using here is available on Docker Hub ( https://hub.docker.com/r/softwareag/apama-correlator/). You must purchase it (free of charge) so that you can use it. After you have done this, proceed as described below.
1. Log in to Docker Hub using your credentials:
docker login
2. Obtain the image from the repository so that it will be available to use:
docker pull softwareag/apama-correlator:version
where version is the current Apama version number (a two-digit number such as 10.11).
Note: 
If you logged in successfully but get an error during the docker pull command, it is likely that there is a spelling mistake or that the image you specified is missing.
3. List the images available to you:
docker images
You should see the image that you pulled in the output of the above command (keep in mind there may be many images if you are using a shared machine).
4. Create a container using the image and run it in Docker:
docker run -d --name container --rm softwareag/apama-correlator:version
The above command will detach after running the container. You can see it running using the following command:
docker ps
You can interact with the running image in many ways (see the Docker documentation for the appropriate commands), but we will now retrieve the logs from the running container and then stop the container.
5. To examine the log of the running container, enter the following command using the name that was set with the --name container argument of the docker run command.
docker logs container
When the above command is executed, the container identifier or the name which you can find in the output of the docker ps command is taken as a parameter.
6. You can now stop the container:
docker stop container
This also removes the container since it was started with the --rm option.
Apama image for Cumulocity IoT microservices
If you are building a microservice for use within Software AG's Cumulocity IoT, then we provide a smaller base image designed for use in that environment ( https://hub.docker.com/r/softwareag/apama-cumulocity-jre). You can use the softwareag/apama-cumulocity-jreversion image anywhere that you could use apama-correlator. Existing Dockerfiles which use apama-correlator but provide APAMA_IMAGE as a build argument can be built using apama-cumulocity-jre instead, using an argument to the docker build command:
docker build -t projectimage \
--build-arg APAMA_IMAGE=softwareag/apama-cumulocity-jre:version projectdir
The base image for Cumulocity IoT only provides a JRE and not a full JDK. It does not have Python support built-in and it only provides connectivity with Cumulocity IoT and not any other Software AG product.
Running as the sagadmin user within a container
Software AG images are configured not to run processes as root by default within containers. This is standard container practice. All images create a user sagadmin with the user identifier and group identifier of 1724. By default, all processes run in the container, and all RUN commands in Dockerfiles using these images as a base run with that user identifier.
COPY commands may need to specify writing as the sagadmin user via the --chown argument. It is recommended to continue using this user for all of your commands within Docker.
If you need to run as another user, you need to add USER statements to your Dockerfile or the appropriate options to your docker run command.