Building the Docker Image for an API Gateway Instance
About this task
The webMethods API Gateway Docker image provides an webMethods API Gateway installation. Depending on the existing installation, the webMethods API Gateway Docker image provides a standard webMethods API Gateway or an advanced webMethods API Gateway instance. When running the image, the webMethods API Gateway is started. The webMethods API Gateway image is created on top of an Integration Server image.
To build a Docker image for an webMethods API Gateway instance
Procedure
Example
A sample shell script for creating an webMethods API Gateway Docker image looks as follows:
echo "is createDockerfile ======================================================="
./is_container.sh createDockerfile
status=$?
if [ $status -ne 0 ]
then
echo "Failed! status: $status"
exit $status
fi
echo "is build =================================================================="
./is_container.sh build
status=$?
if [ $status -ne 0 ]
then
echo "Failed! status: $status"
exit $status
fi
echo "apigw createDockerfile =================================================="
./apigw_container.sh createDockerfile
status=$?
if [ $status -ne 0 ]
then
echo "Failed! status: $status"
exit $status
fi
echo "apigw build ============================================================="
./apigw_container.sh build
status=$?
if [ $status -ne 0 ]
then
echo "Failed! status: $status"
exit $status
fi
docker images
. The following sample result shows the
base image
centos:7, the
Integration Server
image
is:micro, and the
webMethods API Gateway
image
is:apigw.
REPOSITORY TAG IMAGEID CREATED SIZE
is apigw af29373fc98a 15 hours ago 1.3GB
is micro 06e7c0de4807 15 hours ago 1.1GB
centos 7 36540f359ca3 12 days ago 193MB
The Docker images resulting from Docker files created using the createDockerFile command feature the following:
- Docker logging.
webMethods API Gateway Docker containers log to stdout and stderr. The webMethods API Gateway logs can be fetched with Docker logs.
- Docker health check.
webMethods API Gateway Docker containers perform health checks. You can use wget request against the webMethods API Gateway REST API to check the health status of webMethods API Gateway.
The following wget request shows a curl invocation sending a request against the HTTP port. If webMethods API Gateway exposes an HTTPS port, only the wget is created accordingly. The option --no-check-certificate is used to avoid any failure due to certificate problems.
HEALTHCHECK CMD curl --no-check-certificate http://localhost:5555/rest/apigateway/health
The wget checks the webMethods API Gateway availability by sending requests to the webMethods API Gateway REST health resource. If the wget is successful, webMethods API Gateway is considered healthy.
- Graceful shutdown.
Docker stop issues a SIGTERM to the running webMethods API Gateway.