Rate This Document
Findability
Accuracy
Completeness
Readability

Deploying the Tool Using a Dockerfile

If you need to use the Dockerfile to create a DevKit image in a container and use this image to deploy the DevKit, perform the following operations.

Before installation, ensure that the host has at least 20 GB of available space for installing the full package.

  1. Obtain the DevKit WebUI tool package (DevKit-All-x.x.x-Linux-Kunpeng.tar.gz). For details, see Obtaining Software Packages.
  2. Create a Dockerfile on your local PC. Example file:
    # Create a base image, for example, for openEuler 22.03.
    from openeuler-22.03-lts-sp2:latest
    ARG package_name=DevKit-All-x.x.x-Linux-Kunpeng
    
    COPY auto_install.exp $package_name.tar.gz /usr/local/
    # Configure the network and Yum source to ensure that the software package can be installed using Yum.
    RUN yum install -y expect tcl sudo util-linux && \
        yum clean all && \
        cd /usr/local/ && \
        tar xvf $package_name.tar.gz && \
        mv auto_install.exp $package_name/ && \
        cd $package_name/ && \
        expect -f ./auto_install.exp && \
        rm -fr /usr/local/*
    EXPOSE 8086
    
    CMD /opt/DevKit/tools/docker_service.sh start devkit_nginx && /opt/DevKit/tools/docker_service.sh start gunicorn_framework && /opt/DevKit/tools/docker_service.sh start gunicorn_plugin && /opt/DevKit/tools/docker_service.sh start java_perf && tail -f /dev/null
    • package_name indicates the name of the extracted full DevKit WebUI package.
    • x.x.x in DevKit-All-x.x.x-Linux-Kunpeng indicates the version.
  3. Create an auto_install.exp file on your local PC. Example file:
    #!/usr/bin/expect -f
    
    set timeout -1
    spawn ./install.sh
    
    expect {
        "*Do you want to continue*" {send "y\r"; exp_continue}
        "*Enter the sequence number of the tool access mode for your installation*" {send "1\r"}
    }
    expect "*Enter the sequence number of the tool to be installed*"
    send "1\r"
    
    expect {
        "*failed in the installation environment check?*" {send "y\r"; exp_continue}
        "*Enter the installation path*" {send "\r"}
    }
    
    expect {
        "*sequence number of the listed IP address as the web server IP*" {send "\r"; exp_continue}
        "*Please enter the installation port*" {send "\r"; exp_continue}
        "*continue the installation*" {send "y\\n"; exp_continue}
        "*failed in the installation environment check*" {send "y\r"; exp_continue}
        "The tool will create 10 users*" {send "y\n"; exp_continue}
        "*y/n default:*" {send "n\r"; exp_continue}
        "*installation of these components*" {send "y\r"; exp_continue}
        "Are you agree to install the ufw command?*" {send "n\r"; exp_continue}
        "Do you want to set image sources*" {send "n\r"; exp_continue}
        "*do you want to use it*" {send "y\r"; exp_continue}
        eof {
            exit 0
        }
    }
  4. After the download is complete, upload the full DevKit WebUI package, Dockerfile, and auto_install.exp to the same directory on the worker node.

    Directory structure:

  5. Perform the build operation.
    1
    docker build -t devkit-web -f ./Dockerfile .
    

    devkit-web is the image name, which can be customized.

    Build process:

    If information similar to the following is displayed, the build is successful.

  6. View the built image.
    1
    docker image list
    

    Image information:

  7. Start the container.
    docker run -d -p 8086:8086 --name devkit devkit-web:latest
    • In 8086:8086, the first 8086 indicates the host port, which can be customized. You can visit https://host_IP_address:host_port to access the DevKit WebUI. The second 8086 is the default DevKit service port and does not need to be changed.
    • --name devkit specifies the container name, which can be customized.