Accessing a remote Liberty server in a Docker container by using developer tools

You can set up your remote Liberty server in a Docker container so that you can access it by using WebSphere Developer Tools. After you complete this setup, you can use WebSphere Developer Tools to configure and start your remote Liberty server.

Before you begin

  1. Install Cloud Foundry Command Line Interface (CLI) and the Cloud Foundry plug-in for IBM Cloud® Container Service.

    For more information about installation, see IBM Cloud Container Service plug-in.

  2. Log in to your IBM Cloud account and choose your organization and space, and then log in to your IBM Cloud Container Service.

    For more information about logging in to your accounts, see Logging into the CLI.

Procedure

  1. Go to the bin directory of the remote Liberty server.

    By default, the bin directory is in the /opt/ibm/wlp directory.

  2. To access your remote Liberty server in a Docker container, use the following command from the bin directory of the remote Liberty server:
    docker exec -i  ContainerID configUtility install remoteAdministration --vadminUser=Username --vadminPassword=Password --vkeystorePassword=KeystorePassword
    Remember: To find the container ID, use the docker ps command.

    For more information, see the configUtility command documentation.

  3. When the script displays the configuration snippet, copy it into the server.xml file.
  4. Specify the <remoteFileAccess> parameter in the server.xml file by replacing its contents with the following text:
    <writeDir>${server.output.dir}</writeDir>
        <writeDir>${wlp.user.dir}</writeDir>
  5. Optional: To secure your remote Liberty server in a Docker container, change the keystore property.
    By default, the keystore property is the following element:
    <!-- TODO: Set the SSL keystore password -->
    <keyStore id="defaultKeyStore" password="Liberty" />
    1. To change the keystore property, enter the following command from the bin directory of the remote Liberty server:
      docker exec -i ContainerID securityUtility createSSLCertificate --server=ServerName --password=keystorePassword 

      If the keystore password was previously set, then delete the LibertyInstallDirectory/usr/servers/ServerName/resources/security/key.p12 file and use the securityUtility command again.

      Through 19.0.0.2, if the keystore password was previously set, then delete the LibertyInstallDirectory/usr/servers/ServerName/resources/security/key.jks file and use the securityUtility command again.

    2. When the script displays the security element, copy it to your clipboard.
    3. Replace the keystore element in the server.xml file with the security element that you copied.
  6. Save the server.xml file.

What to do next

You can configure and start a remote Liberty server that is in a Docker container.

Distributed: [AIX MacOS Linux Windows]For more information about how to configure and start a remote Liberty server, see Creating a remote Liberty server by using developer tools.