Step 5 – Create base Docker image

To create a base Docker image containing an operating system and an API Gateway installation, use the build_base_image.py script. This script builds a base API Gateway Docker image using an API Gateway7.6.2 UNIX/Linux installer and a Docker image based on a standard or custom CentOS7 or RHEL7 operating system image.

You must specify the following as options when using the build_base_image.py script:

  • API Gateway 7.6.2 UNIX/Linux installer
  • Operating system (uses standard CentOS7 or RHEL7 Docker image) or a custom CentOS7 or RHEL7 based OS Docker image to base the image on:
    • Standard CentOS7 Docker image downloaded from the public Docker registry
    • Standard RHEL7 Docker image downloaded from the Red Hat official Docker registry
    • If you specify a custom CentOS7 or RHEL7 based OS Docker image, Docker first tries to find the custom image in the local registry, and then tries to download it from a remote registry
Note   You must have an RHEL7 license to build a base API Gateway image based on an RHEL7 OS.

This script also supports additional options when generating a base image. For the latest script usage and options, run the script with no options, or with the -h option. For example:

$ cd emt_containers-<version>
$ ./build_base_image.py -h

The following examples show how you can use the script to build base Docker images:

Create a base image based on standard CentOS7

The following example creates a base Docker image using a standard CentOS7 image.

Example command

$ cd emt_containers-<version>
$ ./build_base_image.py
--installer=apigw-installer.run 
--os=centos7

This example creates a base Docker image named apigw-base with a tag of latest. The image is based on a standard CentOS7 Docker image.

Create a base image based on standard RHEL7

The following example creates a base Docker image using a standard RHEL7 image.

Usage guidelines

  • You must have an RHEL7 license to build a base API Gateway image based on an RHEL7 OS.

Example command

$ cd emt_containers-<version>
$ ./build_base_image.py 
--installer=apigw-installer.run 
--os=rhel7 --out-image=my-gw-base:1.0

This example creates a base Docker image named my-gw-base with a tag of 1.0. The image is based on a standard RHEL7 Docker image.

Create a base image based on custom CentOS7/RHEL7

The following example creates a base Docker image using a custom RHEL7 image.

Usage guidelines

  • You must have an RHEL7 license to build a base API Gateway image based on an RHEL7 OS.

Example command

$ cd emt_containers-<version>
$ ./build_base_image.py
--installer=apigw-installer.run 
--parent-image=my-custom-rhel:2.0 
--out-image=my-custom-gw-base:1.0

This example creates a base Docker image named my-custom-gw-base with a tag of 1.0. The image is based on the specified my-custom-rhel:2.0 Docker image.

Related Links