[8.5.5.9 or later]
This topic applies to WebSphere Application Server Liberty V8.5.5.9 and earlier. For the latest Liberty topics, see the WebSphere Application Server Liberty documentation.

Creating a workbench Liberty server in a Docker container by using developer tools

You can use WebSphere Developer Tools to create a reference in the workbench to a Liberty server that is running in a Docker container. You can use this reference to handle your server requests from the workbench.

Before you begin

  • Install WebSphere Developer Tools. For more information about installing WebSphere Developer Tools, see Installing the Liberty developer tools and (optionally) Liberty.
  • Start a Liberty server in a local Docker container and ensure that both the HTTP and HTTPS ports are mapped to the host. For more information about starting a Liberty server in a local Docker container, see WASdev GitHub.

About this task

Remember: You can create a reference in the workbench to a Liberty server that is running in a Docker container.

As you complete the steps, you can install WebSphere Application Server Liberty and download add-ons in the Liberty Repository from the WASdev community download site. After you install Liberty, you can select your Docker container. Then, you can enter the Liberty server security credentials for your Liberty server to create a workbench reference to your Liberty server in your Docker container.

Procedure

  1. In the workbench, open the Servers view by clicking the Servers tab.
    Tip: If the Servers view is not visible, select Window > Show view > Other... and type Server in the filter text. Then, select Servers.
  2. Right-click the Servers view and select New > Server.
  3. To select your server type, select IBM > WebSphere Application Server Liberty.
  4. Enter the localhost value in the Server's host name field.
  5. Click Next.
  6. If the tools prompt you to install WebSphere Application Server Liberty, either because it is not installed or because you need to input the directory where it is installed, complete one of the following options. Otherwise, skip this step.

    You need Liberty to be installed so that you can create a workbench reference to a Liberty server in a Docker container.

    If you previously installed Liberty, complete the following steps to select the directory where you installed it:

    1. Select Choose an existing installation.
    2. In the Path field, type or browse for the directory where you installed the WebSphere Application Server Liberty.
    3. On the Liberty Runtime Environment page, click Next.

      The application-serving environment is selected. Skip the rest of this step.

    If you want to install Liberty from an archive file that was previously downloaded, complete the following steps:

    1. Select Install from an archive or repository, and click Next.
    2. In the Destination field, type or browse to the directory where you want to install the Liberty runtime environment.

      If you type a path that does not exist, then a folder for that path is created automatically at the end of the procedure when you click Finish.

    3. Select Install a new runtime environment from an archive.
    4. In the Path field, either type or browse to the archive file on the local file system, and click Next.
    5. In the Install Add-ons page, click Install or Install Pending to make your selection of add-on archive files that you want to install on the Liberty runtime environment.

      You can install an add-on archive file from your local file system, download an add-on archive file, or use a combination of both when you install multiple add-on archive files. If the workbench is connected to the internet, the Install Add-ons page is populated with add-on archive files available for download from the WAS dev community download site.

      This download site includes add-ons that you can select from the Liberty Repository, such as runtime features, samples, or open source integration.

      If you want to install add-on archive files from your local file system, complete the following steps:
      1. Click Add Archive.
      2. In the Add-on archive field, type or browse to the add-on archive file on the local file system.
      3. Click OK.
      If you have more add-on archive files to install from your local file system, repeat this procedure until you are done.
      If you want to install add-on files from a custom repository, complete the following steps:
      1. To add the repository, click Configure Repositories.
      2. Click New....
      The files are then added to the list of add-on files.

      After you complete your selection in the Install Add-ons page, click Next.

    6. In the License Acceptance page, if you accept the license terms, select I accept the terms of all the license agreements then click Next.

    If you want to download and install the no-charge developer edition for Liberty, complete the following steps:

    1. Select Install from an archive or repository, and click Next.
    2. In the Destination field, type or browse to the directory where you want to install the Liberty runtime environment.

      If you type a path that does not exist, then a folder for that path is created automatically at the end of the main procedure when you click Finish.

    3. Select Download and install a new runtime environment from ibm.com, choose a runtime environment version, and then click Next.
    4. In the Install Add-ons page, click Install or Install Pending to make your selection of add-on archive files that you want to install on the Liberty runtime environment.

      You can install an add-on archive file from your local file system, download, or use a combination of both when you install multiple add-on archive files. If the workbench is connected to the internet, the Install Add-ons page is populated with add-on archive files available for download from the WAS dev community download site.

      This download site includes add-ons that you can select from the Liberty Repository, such as runtime features, samples, or open source integration.

      If you want to install add-on archive files from your local file system, click Add Archive. In the Add-on archive field, type or browse for the add-on archive file on the local file system, and then click OK. If you have more add-on archive files to install from your local file system, repeat this step until you are done.

      If you want to install add-on files from a custom repository, first add the repository by clicking Configure Repositories. Click New... to add the repository. The files are then added to the list of add-on files.

      After you complete your selection in the Install Add-ons page, click Next.

    5. In the License Acceptance page, if you accept the license terms, select I accept the terms of all the license agreements then click Next.
  7. On the Liberty Server Type page, select Server in a Docker container.
  8. Click Next.

    The tools display the New Liberty Server in Docker Container page.

  9. Select your Docker container from the Container name menu.
  10. Enter the Liberty server security credentials.
    Your values for the User name and Password fields must correspond to a user that is defined in a user registry that has an administrator role. If the tools cannot find a basic user registry that defines the specified user, the tools display the Security Verification window. If the tools display the Security Verification window, complete one of the following options:
    • Select Create to add a basic user registry that defines a user with your values and an administrator role.
    • Select Proceed to proceed if the user is defined in another user registry type.
    • Select Cancel to make changes to the User name and Password that you entered.
  11. Enter the value for the Host mapped secured port field that corresponds to the HTTPS port in the server configuration.
  12. Click Finish.

Results

You created a workbench server reference to a server that is running in a Docker container.

  • To see the server that you created and its server configuration, open the Servers view.
  • To see the project, the server folder, and the server configuration files, open the Enterprise Explorer view.

What to do next

  • You can edit the server configuration. For more information, see Editing the Liberty configuration by using developer tools
  • To start or stop a server, or add or remove applications on the server, right-click your server to use the server context menu or use the tray buttons in the Servers view. For more information, see Starting and stopping a server by using developer tools.
    Remember: To access these options, select the Server Entry in the Servers view. Do not select a server configuration such as the Server Configuration or server.xml entry.
    Tip: The application address that the server logs in the Console view is valid within the Docker container only. To load an application in a browser, use the host mapped IP address and host mapped HTTP or HTTPS port. If you use the Run on Server or Debug on Server options, the application is automatically loaded with the correct IP address and port.

    To make it easier to determine the correct port, map the ports to specific ports on the host by using the -p option rather than the -P option when you create the Docker container.

  • You can configure your Liberty server to authenticate users with Tivoli Directory Server.
    1. Right-click Servers.
    2. Select Utilities > Add config snippets.
    3. Select the snippets and accept the licenses agreements.
    The tools download the configuration snippets that you selected and add them to the server.xml file.

Icon that indicates the type of topic Task topic



Timestamp icon Last updated: Tuesday, 12 December 2017
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-libcore-mp&topic=t_creating_server_docker
File name: t_creating_server_docker.html