您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

在 Azure 上的 Docker 容器中运行微聚焦企业服务器5。0Run Micro Focus Enterprise Server 5.0 in a Docker container on Azure

可以在 Azure 上的 Docker 容器中运行微聚焦企业服务器5.0。You can run Micro Focus Enterprise Server 5.0 in a Docker container on Azure. 本教程将向您介绍如何操作。This tutorial shows you how. 它使用适用于企业服务器的 Windows CICS (客户信息控制系统) acctdemo 演示。It uses the Windows CICS (Customer Information Control System) acctdemo demonstration for Enterprise Server.

Docker 增加了应用程序的可移植性和隔离性。Docker adds portability and isolation to applications. 例如,你可以将 Docker 映像从一个 Windows 虚拟机 (VM) 导出到另一台 Windows 虚拟机上,也可以从存储库导出到使用 Docker 的 Windows server。For example, you can export a Docker image from one Windows virtual machine (VM) to run on another, or from a repository to a Windows server with Docker. Docker 映像在具有相同配置的新位置运行,无需安装企业服务器。The Docker image runs in the new location with the same configuration—without having to install Enterprise Server. 它是映像的一部分。It’s part of the image. 许可注意事项仍适用。Licensing considerations still apply.

本教程通过 Azure Marketplace 安装 带有容器 VM 的 Windows 2016 DatacenterThis tutorial installs the Windows 2016 Datacenter with Containers VM from the Azure Marketplace. 此 VM 包含 Docker 18.09.0This VM includes Docker 18.09.0 . 下面的步骤演示了如何部署容器,运行它,然后使用3270模拟器连接到该容器。The steps that follow show you how to deploy the container, run it, and then connect to it with a 3270 emulator.

先决条件Prerequisites

在开始之前,请先查看以下先决条件:Before getting started, check out these prerequisites:

  • Azure 订阅。An Azure subscription. 如果还没有该订阅,可以在开始前创建一个免费帐户If you don't have one, create a free account before you begin.

  • 微重点软件和有效许可证 (或试用许可证) 。The Micro Focus software and a valid license (or trial license). 如果你是现有的微聚焦客户,请联系你的微侧重点代表。If you're an existing Micro Focus customer, contact your Micro Focus representative. 否则, 请求试用Otherwise, request a trial.

    备注

    Docker 演示文件包含在企业服务器5.0 中。The Docker demonstration files are included with Enterprise Server 5.0. 本教程使用 ent _ server _ dockerfile _ 5.0 _windows.zip。This tutorial uses ent_server_dockerfiles_5.0_windows.zip. 从访问企业服务器安装文件的同一位置访问它,或转到 " " 以开始使用。Access it from the same place that you accessed the Enterprise Server installation file or go to Micro Focus to get started.

  • 企业服务器和企业开发人员的文档。The documentation for Enterprise Server and Enterprise Developer.

创建 VMCreate a VM

  1. 保护 ent _ server _ dockerfile _ 5.0 _windows.zip 文件中的媒体。Secure the media from the ent_server_dockerfiles_5.0_windows.zip file. 确保 (生成 Docker 映像所需的 mflic 许可文件,以确保) 。Secure the ES-Docker-Prod-XXXXXXXX.mflic licensing file (required to build the Docker images).

  2. 创建 VM。Create the VM. 为此,请打开 Azure 门户,从左上方菜单中选择 " 创建资源 ",并按 " windows server 操作系统 " 进行筛选。To do this, open Azure portal, select Create a resource from the top left menu, and filter by windows server operating system . 在结果中,选择 " Windows Server"。In the results, select Windows Server. 在下一屏幕中,选择 " Windows Server 2016 Datacenter – With 容器 "。In the next screen, select Windows Server 2016 Datacenter – with Containers .

    Azure 门户搜索结果的屏幕截图

  3. 若要配置 VM 的属性,请选择 "实例详细信息":To configure the properties for the VM, choose instance details:

    1. 选择 VM 大小。Choose a VM size. 对于本教程,请考虑使用 标准 DS2 _ v3 VM,其中包含2个个 VCPU 和 16 GB 的内存。For this tutorial, consider using a Standard DS2_v3 VM with 2 vCPUs and 16 GB of memory.

    2. 选择要部署到的 区域资源组Select the Region and Resource Group to which you would like to deploy.

    3. 对于 可用性选项 ,请使用默认设置。For Availability options , use the default setting.

    4. 对于 " 用户名 ",请键入要使用的管理员帐户和密码。For Username , type the administrator account you want to use and the password.

    5. 请确保已打开 端口 3389 RDPMake sure port 3389 RDP is open. 只需公开此端口,即可登录到 VM。Only this port needs to be publicly exposed, so you can sign in to the VM. 然后,接受所有默认值,然后单击 " 查看 + 创建 "。Then, accept all the default values and click Review + create .

    "创建虚拟机" 窗格的屏幕截图

  4. 等待部署完成 (几分钟) 。Wait for the deployment to finish (a couple of minutes). 将出现一条消息,指出已创建你的 VM。A message states that your VM has been created.

  5. 选择 " 中转到资源 " 以前往 VM 的 " 概述 " 边栏选项卡。Select Go to Resource to go to the Overview blade for your VM.

  6. 在右侧,选择 " 连接 "。On the right, select Connect . 右侧将显示 " 连接到虚拟机 " 选项。The Connect to virtual machine options appear on the right.

  7. 选择 " 下载 RDP 文件 " 按钮,以便 (RDP) 文件下载远程桌面协议,该协议可用于附加到 VM。Select the Download RDP File button to download the remote desktop protocol (RDP) file that allows you to attach to the VM.

  8. 文件下载完成后,打开它,键入为 VM 创建的用户名和密码。After the file has finished downloading, open it and type in the username and password you created for the VM.

    备注

    不要使用企业凭据登录。Do not use your corporate credentials to sign in. (RDP 客户端假设你可能想要使用它们。(The RDP client assumes you may want to use these. 不是。 ) You do not.)

  9. 选择 " 更多 选择",然后选择 VM 凭据。Select More Choices , then select your VM credentials.

此时,VM 正在运行,并通过 RDP 连接。At this point, the VM is running and attached via RDP. 你已登录并准备好进行下一步。You're signed in and ready for the next step.

创建沙盒目录并上传 zip 文件Create a sandbox directory and upload the zip file

  1. 在 VM 上创建一个目录,你可以在其中上载演示和许可证文件。Create a directory on the VM where you can upload the demo and license files. 例如, C: \ 沙盒For example, C:\Sandbox .

  2. ent _ server _ dockerfile _ 5.0 _windows.zipmflic 文件上传到所创建的目录。Upload ent_server_dockerfiles_5.0_windows.zip and the ES-Docker-Prod-XXXXXXXX.mflic file to the directory you created.

  3. 将 zip 文件的内容提取到提取过程创建的 ent _ server _ dockerfile _ 5.0 _ windows 目录中。Extract the contents of the zip file to the ent_server_dockerfiles_5.0_windows directory created by the extract process. 此目录包含一个自述文件 (为 .html 和 .txt 文件) 和两个子目录 EnterpriseServer示例This directory includes a readme file (as .html and .txt file) and two subdirectories, EnterpriseServer and Examples .

  4. mflic 复制到 C: \ 沙盒 \ ent _ server _ dockerfile _ 5.0 _ windows \ EnterpriseServer 和 c: \ 沙盒 \ ent _ server _ dockerfile _ 5.0 _ windows \ 示例 \ CICS 目录。Copy ES-Docker-Prod-XXXXXXXX.mflic to the C:\Sandbox\ent_server_dockerfiles_5.0_windows\EnterpriseServer and C:\Sandbox\ent_server_dockerfiles_5.0_windows\Examples\CICS directories.

    备注

    请确保将许可文件复制到这两个目录。Make sure you copy the licensing file to both directories. 它们对于 Docker build 步骤是必需的,以确保映像获得正确许可。They are required for the Docker build step to make sure the images are properly licensed.

检查 Docker 版本并创建基础映像Check Docker version and create base image

重要

创建相应的 Docker 映像的过程分为两个步骤。Creating the appropriate Docker image is a two-step process. 首先,创建企业服务器5.0 基础映像。First, create the Enterprise Server 5.0 base image. 然后为 x64 平台创建另一个映像。Then create another image for the x64 platform. 尽管可以创建 x86 (32 位) 映像,但请使用64位映像。Although you can create a x86 (32-bit) image, use the 64-bit image.

  1. 打开命令提示符。Open a command prompt.

  2. 检查是否已安装 Docker。Check that Docker is installed. 在命令提示符下,键入: docker 版本At the command prompt, type: docker version
    例如,当编写此版本时,将18.09.0 版本。For example, the version was 18.09.0 when this was written.

  3. 若要更改目录,请键入:To change the directory, type:
    cd \沙盒 \ ent _ server _ dockerfile _ 5.0 _ windows \ EnterpriseServercd \Sandbox\ent_server_dockerfiles_5.0_windows\EnterpriseServer .

  4. 键入 bld.bat IacceptEULA ,开始初始基本映像的生成过程。Type bld.bat IacceptEULA to begin the build process for the initial base image. 等待几分钟以便运行此进程。Wait a few minutes for this process to run. 在结果中,请注意创建了两个映像:一个用于 x64,一个用于 x86:In the results, notice the two images that have been created—one for x64 and one for x86:

    显示图像的命令窗口

  5. 若要为 CICS 演示创建最终映像,请通过键入 cd \ 沙箱 \ ent _ server _ dockerfile _ 5.0 _ windows \ 示例 \ cics 切换到 cics 目录。To create the final image for the CICS demonstration, switch to the CICS directory by typing cd\Sandbox\ent_server_dockerfiles_5.0_windows\Examples\CICS .

  6. 若要创建映像,请键入 bld.bat x64To create the image, type bld.bat x64 . 请等待几分钟,让进程运行,并显示一条消息,指出已创建该映像。Wait a few minutes for the process to run and the message saying that the image was created.

  7. 键入 docker 映像 以显示 VM 上安装的所有 docker 映像的列表。Type docker images to display a list of all of the Docker images installed on the VM. 请确保 microfocus/acctdemo 是其中之一。Make sure microfocus/es-acctdemo is one of them.

    显示 acctdemo 映像的命令窗口

运行映像Run the image

  1. 若要启动企业服务器5.0 和 acctdemo 应用程序,请在命令提示符下键入:To launch Enterprise Server 5.0 and the acctdemo application, at the command prompt type:

    **docker run -p 16002:86/tcp -p 16002:86/udp -p 9040-9050:9040-9050 -p 9000-9010:9000-9010 -ti --network="nat" --rm microfocus/es-acctdemo:win\_5.0\_x64
    
  2. 安装3270终端模拟器(如 x3270 ),并使用它将端口9040附加到运行的映像。Install a 3270 terminal emulator such as x3270 and use it to attach, via port 9040, to the image that’s running.

  3. 获取 acctdemo 容器的 IP 地址,以便 Docker 可以充当其管理的容器 (DHCP) 服务器的动态主机配置协议:Get the IP address of the acctdemo container so Docker can act as a Dynamic Host Configuration Protocol (DHCP) server for the containers it manages:

    1. 获取正在运行的容器的 ID。Get the ID of the running container. 在命令提示符处键入 Docker ps ,并记下此示例中的 ID ( 22a0fe3159d0 ) 。Type Docker ps at the command prompt and note the ID ( 22a0fe3159d0 in this example). 将其保存到下一步。Save it for the next step.

    2. 若要获取 acctdemo 容器的 IP 地址,请使用上一步中的容器 ID,如下所示:To get the IP address for the acctdemo container, use the container ID from the previous step as follows:

    docker inspect \<containerID\> --format="{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}"
    

    例如:For example:

    docker inspect 22a0fe3159d0 --format="{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}"
    
  4. 请注意 acctdemo 映像的 IP 地址。Note the IP address for the acctdemo image. 例如,以下输出中的地址为172.19.202.52。For example, the address in the following output is 172.19.202.52.

    显示 IP 地址的命令窗口屏幕截图

  5. 使用模拟器装载映像。Mount the image using the emulator. 将仿真程序配置为使用 acctdemo 映像和端口9040的地址。Configure the emulator to use the address of the acctdemo image and port 9040. 下面是 172.19.202.52: 9040Here, it’s 172.19.202.52:9040 . 你的情况将类似。Yours will be similar. " 登录到 CICS " 屏幕将打开。The Sign on to CICS screen opens.

    登录到 CICS 的屏幕截图

  6. 输入 用户 idSYSADSYSAD 作为 密码 ,以登录到 CICS 区域。Sign in to the CICS Region by entering SYSAD for the USERID and SYSAD for the Password .

  7. 使用仿真程序的快捷键映射清除屏幕。Clear the screen using the emulator’s keymap. 对于 x3270,请选择 " 快捷键映射 " 菜单选项。For x3270, select the Keymap menu option.

  8. 若要启动 acctdemo 应用程序,请键入 " 帐户 "。To launch the acctdemo application, type ACCT . 将显示应用程序的初始屏幕。The initial screen for the application is displayed.

    屏幕截图显示了一个显示应用程序的控制台窗口。

  9. 试用显示帐户类型。Experiment with display account types. 例如,键入 D 作为请求,将 11111 键入 帐户For example, type D for the Request and 11111 for the ACCOUNT . 要尝试的其他帐号为22222、33333等。Other account numbers to try are 22222, 33333, and so on.

    屏幕截图显示在应用程序中编辑不同的值。

  10. 若要显示 Enterprise Server 管理控制台,请打开命令提示符,然后键入 start http:172.19.202.52: 86To display the Enterprise Server Administration console, go to the command prompt and type start http:172.19.202.52:86 .

    企业服务器管理控制台

就这么简单!That's it! 现在正在运行并在 Docker 容器中管理 CICS 应用程序。Now you're running and managing a CICS application in a Docker container.

后续步骤Next steps