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.
- Install Docker. For more information about installing Docker, see Docker support in Liberty. Important: The tools support Docker version 1.10.2 and later.
- 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.
- If you are using Mac OS, by default Docker commands are located in the
/usr/local/bin directory. If you change the location of the Docker commands,
complete the following steps so that the tools can find the Docker commands:
- Add the following line to the eclipse.ini
file:
-Dcom.ibm.ws.st.envPath=<Docker commands directory> - Restart Eclipse.
- Add the following line to the eclipse.ini
file:
About this task
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.
If a Docker command times out as you complete these steps, you can work around this problem. Set the com.ibm.ws.st.DockerCommandTimeoutInSeconds system property to a time in seconds. By default, this property is set to 10.
Procedure
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.Restriction: The tools do not support specifying include files by using absolute paths in the server configuration. To work around this problem, specify include paths by using the predefined server variables such as server.config.dir and shared.config.dir, instead of by using absolute paths.
- 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.Tip: 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.
- You can configure your Liberty server to authenticate users with Tivoli
Directory Server.
- Right-click Servers.
- Select .
- Select the snippets and accept the licenses agreements.
Task topic