Generating Docker image from installation

You can generate a Docker image for the operating system of your preference.

About this task

Using the generateDockerfile script file, you can generate a Docker image from Developer Portal installation.

Prerequisites

Before you build a Docker image for Developer Portal, you must complete the steps.
  • Install the Docker client on the machine on which you are going to install Developer Portal and start Docker as a daemon. The Docker client must have connectivity to the Docker server to create images.
  • Install Developer Portal packages and fixes on a Linux or UNIX system and then configure Developer Portal and the hosted products.

To generate a Dockerfile and image

  1. Run the following command with parameters. You can provide any or all parameters according to your requirements.
    sudo sh generateDockerfile
    You can provide any of the parameters that are listed in the List of parameters that can be provided with the generateDockerfile script section with the preceding command.
    Sample command
    sudo sh generateDockerfile --os.image ubuntu:20.04 
    --installation.path fs/fslocal/Portal1015
    You can run this command with the --build parameter to build the Docker image in one step or generate a Dockerfile and then generate the Docker image.
    Tip: Run the generateDockerfile command with the parameter --h to view the list of parameters that you can provide with the command:
    sudo sh generateDockerfile --h
  2. Run the following command to generate a Docker image from the Dockerfile:
    docker build -t image_name
    Sample command
    docker build -t dpo_image

List of parameters that can be provided with the generateDockerfile script

Developer Portal offers the following parameters that you can use to provide your preferences for generating Dockerfile and image:
Parameter Description Default value
--extern.ES Specifies whether the generated Docker image must point to an external database.
Possible values are:
  • true. Uses an external Elasticsearch.
  • false. Uses the Elasticsearch that comes with Developer Portal installation.
  • False
--os.image Specifies the base operating system of the Docker image.
Note: Ensure that the operating system name and version that is provided for this parameter matches with the name and version of the corresponding operating system (tag) in the Docker hub.
  • centos:7
--build Specifies whether a Docker image needs to be generated.
Possible values are:
  • true. A docker image is generated when you run the command.
  • false. A docker image is not generated.
  • False
--installation.path Specifies the Developer Portal installed directory. /opt/SoftwareAG
--extern.ES.url Specifies the external Elasticsearch URL. Provide this value to point your Docker image to an external database.
--docker.image.name Specifies the name for the Docker image. You need to provide this value to generate a Docker image.

If you provide the --build parameter and do not provide this parameter, then the generated the default value wm_developer_portal is given as the name of the generated Docker image.

  • wm_developer_portal
--keep.ES.data Specifies whether the data in the Elasticsearch of the base installation must be included in the generated Dockerfile.
  • False