Do you have a Java EE application which is running successfully on your laptop and now you want to run it in a Docker container? Maybe you then want to take that container and deploy it to IBM Containers? What if that application requires access to a database?
The following videos can help you in getting started.
The first video demonstrates how to extend the websphere-liberty:kernel Docker image available in the Docker Hub public registry to build a new image. The new image adds the DayTrader sample application and the WebSphere Liberty features that it requires. DayTrader requires access to a DB2 database which, in this first scenario, is also running on the local machine.
Now we have learnt how to package the application as a Docker image, let’s see how we can take that same image and run it on IBM Containers, part of IBM Bluemix.
The following video demonstrates how to create a Secure Gateway Service in Bluemix and configure that with the DB2 database running on an on-premise system. The DayTrader application is then pushed to the IBM Containers registry and then run. The application accesses the on-permise DB2 database via the Secure Gateway Service. Note that, in this video, an application is used to bind the Secure Gateway service to the container, but this step is no longer required. It is now possible to bind the service directly to the container when the container is created.
We have learnt how to run the DayTrader application in IBM Containers with DB2 running on-premise. Let’s now run DB2 also in a container.
The final video demonstrates how to pull the websphere-liberty:kernel and ibmcom/db2express-c docker images from Docker Hub and build a new WebSphere Liberty image with the DayTrader application. The Liberty and DB2 containers share a network so that they can communicate with each other.