Hitachi

JP1 Version 12 JP1/Automatic Job Management System 3 Configuration Guide


21.8.1 Procedure for creating a container image

The following shows the procedure for incorporating JP1/AJS3 - Agent into a container image:

  1. Create a JP1/Base container image.

    For details about how to create a JP1/Base container image, see the JP1/Base User's Guide. In this step, do not activate the container. If the container is active, de-activate it.

  2. Copy the contents of the JP1/AJS3 - Agent media to a Dockerfile storage directory.

    Make sure that the original and copy files and directories match at the binary level.

    # mount /dev/cdrom mount-point-directory-on-the-host
    # cp -a mount-point-directory-on-the-host Dockerfile-storage-directory

    In the sample Dockerfile shown in step 3, the contents of the JP1/AJS3 - Agent media are copied to Dockerfile-storage-directory/media/JP1AJS. You can use any directory of your choice for Dockerfile-storage-directory. Make sure that the Dockerfile storage directory specified here is different from the Dockerfile storage directory specified in JP1/Base. Also make sure that the Dockerfile storage directory specified here is not contained in the Dockerfile storage directory specified in JP1/Base.

  3. Create a Dockerfile from which to create a Docker image.

    The following shows a sample Dockerfile. For details about the format of a Dockerfile, see Dockerfile reference or man dockerfile provided by Docker, Inc.

    FROM image-name[:tag-name]#1
    MAINTAINER creator <email-address>#2
    RUN yum -y install libuuid.i686#3
    RUN mkdir /var/tmp/JP1/JP1AJS#4
    COPY media/JP1AJS /var/tmp/JP1/JP1AJS#5
    WORKDIR /var/tmp/JP1/JP1AJS#6
    RUN export LANG=ja_JP.utf8 && ./LINUX/setup -f -k P-8112-33CL ./#7
    RUN rm -rf /var/tmp/JP1/JP1AJS#8
    #1:

    Specify the container image you created in step 1 as the base image. To use the latest version of image, specify latest for tag-name.

    #2:

    Specify the full name of the creator as the manager of the image and the creator's email address as the contact information. You can omit this parameter.

    #3:

    This parameter specifies that the package software required by JP1/AJS3 - Agent was installed beforehand.

    #4:

    This parameter specifies that a work directory is created in the container.

    #5:

    This parameter specifies that the contents of the product media that have already been copied to a Dockerfile storage directory need to be copied to the /var/tmp/JP1/JP1AJS work directory in the container.

    #6:

    This parameter specifies that the current directory is changed to /var/tmp/JP1/JP1AJS in the container.

    #7:

    This parameter sets the LANG environment variable according to the language, and then specifies that JP1/AJS3 - Agent is installed in the container by using the silent installation function of the Hitachi program product installer. Make sure that the value of the LANG environment variable set in this parameter and the value of the LANG environment variable used by JP1/Base are the same. In the preceding example, UTF-8 is set. For the languages that can be used, see 2.4.2 Language type and character encoding of the system in the JP1/Automatic Job Management System 3 System Design (Configuration) Guide.

    #8:

    This parameter specifies that the work directory in the container is to be deleted.

  4. Run the docker build command, specifying the Dockerfile created in step 3, to create a container image.

    On the container host machine, run the following command. If you use Podman instead of Docker, replace docker by podman on the command line.

    # docker build -t image-name:tag-name Dockerfile-storage-directory

    Note that to run this command as shown in the example in this procedure, you must change the current directory to the Dockerfile storage directory.