Hitachi

JP1 Version 12 JP1/Base User's Guide


O.1 Creating a Docker image

The following describes how to import this software product into a Docker image:

  1. Copy the product media content to the Dockerfile storage directory in advance.

    Make sure that the copied files match by performing a comparison (at the binary level).

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

    In the Dockerfile example provided below, the product media is copied to Dockerfile-storage-directory/media.

  2. If the system has a local yum repository server specified, the repository file is created in the Dockerfile storage directory.

  3. Create a Dockerfile in order to create a Docker image.

    A sample is shown below. For details about the Dockerfile format, see the Dockerfile reference which is posted on the Docker website, or refer to man dockerfile.

    FROM rhel7.1:latest #1
    MAINTAINER Name mail address #2
    COPY local.repo /etc/yum.repos.d/ #3
    RUN yum -y install glibc.i686 libstdc++.i686 ncompress ncursespsmisc glibc-devel glibc-devel.i686 #4
    RUN yum -y install tar iputils net-tools procps-ng hostname #5
    RUN localedef -i ja_JP -f UTF-8 ja_JP.utf8 #6
    RUN mkdir /var/tmp/JP1 #7
    COPY media /var/tmp/JP1 #8
    WORKDIR /var/tmp/JP1 #9
    RUN export LANG=ja_JP.utf8 && ./LINUX/setup -f -k product-type ./ #10
    ...
    RUN rm -rf /var/tmp/JP1 #11
    #1

    Specify the base Docker image. The script :latest specifies the latest image.

    #2

    As the image administrator, specify the name or contact email address of the person who created the image. This step can be omitted.

    #3

    Specify that the repository file created in advance is to be copied into the container.

    #4

    Specify that the prerequisite packages for this product are to be installed in advance.

    #5

    When using a Docker image from Linux 7 as a base image, install the commands that are not installed by default (tar, ps, hostname, netstat, and ping).

    #6

    Add locales. (In the example above, UTF-8 is added.)

    #7

    Create a work directory in the container.

    #8

    Specify that the following is to be copied to /var/tmp/JP1 on the container: the contents of the product media that were previously copied to the Dockerfile storage directory.

    #9

    Specify that the current directory is to be set as /var/tmp/JP1 on the container.

    #10

    Specify the LANG environment parameter according to the language requirements, and then specify that the installation is to be performed on the container by using the silent installation functionality of Hitachi Program Product Installer. (In the above example, UTF-8 is specified.)

    If you do not specify the LANG environment parameter, the installation setup is performed assuming a C environment.

    #11

    Specify that the work directory on the container is to be deleted.

  4. Use the docker build command to specify the Dockerfile created in step 3, and then create the Docker image.

    # docker build -t Docker-image-name Dockerfile-storage-directory

    To execute the above command, using the example of a Dockerfile created in step 3, the current directory must be the Dockerfile storage directory.