The other day, I was told to do hands-on in the title, so I will write the procedure before I forget it. What I want to do is create a Docker image with OpenLiberty from my Java app (which is a war file) and deploy that image on the IBM Cloud. This time, you can also create a light account for free, so even beginners should definitely try it.
The procedure is
The app (servant) is extremely simple, but you should be able to create complex apps.
Create a Kubernetes cluster on IBM Cloud This was made with reference to this. https://cloud.ibm.com/docs/containers?topic=containers-cs_cluster_tutorial&locale=ja I did it with a free cluster that can be created with a light account.
Create a local Docker Docker image and upload it to Docker Hub Run the following command on your PC or MAC Download the Open Liberty Docker image $ docker image pull open-liberty
FROM open-liberty COPY ./book-deploy.war /config/dropins/book-deploy.war
Place the war file in the same folder and create a Docker image of open liberty-handson with the following command. $ docker build . openliberty-handson
Upload to Docker Hub if you can
$ docker tag openliberty-handson
It's done. Next, check the IP address and port number and access from a browser.
IP address is
$ ibmcloud cs workers
Let's access it with a browser!
Recommended Posts